• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UserLogin_mst类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UserLogin_mst的典型用法代码示例。如果您正苦于以下问题:C# UserLogin_mst类的具体用法?C# UserLogin_mst怎么用?C# UserLogin_mst使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UserLogin_mst类属于命名空间,在下文中一共展示了UserLogin_mst类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Showvalues

    protected void Showvalues()
    {
        int incidentid = Convert.ToInt32(Session["incidentid"]);

        ObjIncident = ObjIncident.Get_By_id(incidentid);
        ObjIncidentStates = ObjIncidentStates.Get_By_id(incidentid);
        // drpTechnician.SelectedValue = ObjIncidentStates.Technicianid.ToString();
        drpCategory.SelectedValue = ObjIncidentStates.Categoryid.ToString();
        BindDropSubCategory();
        drpSubcategory.SelectedValue = ObjIncidentStates.Subcategoryid.ToString();

        // drpPriority.SelectedValue = ObjIncidentStates.Priorityid.ToString();
        txtTitle.Text = ObjIncident.Title.ToString();
        if (ObjIncident.Description != null)
        { txtDescription.Text = ObjIncident.Description.ToString(); }

        UserLogin_mst objUsr = new UserLogin_mst();
        ContactInfo_mst objInfo = new ContactInfo_mst();
        objInfo = objInfo.Get_By_id(ObjIncident.Requesterid);
        objUsr = objUsr.Get_By_id(ObjIncident.Requesterid);
        txtUsername.Text = objUsr.Username;
        txtEmail.Text = objInfo.Emailid;
        ViewState["UserCreate"] = "Exist";
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:24,代码来源:CreateChangefromIncident.aspx.cs


示例2: btnAdd_Click

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        bool FlagUserStatus = true;
        #region Find Userid of User who is Requesting to log a call

        #region If User Already Exist
        if (ViewState["UserCreate"].ToString() == "Exist")
        {
            objOrganization = objOrganization.Get_Organization();
            ObjUserLogin = ObjUserLogin.Get_UserLogin_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
            if (ObjUserLogin.Userid != 0)
            {
                requesterid = ObjUserLogin.Userid;
            }
        }
        #endregion
        #region If New User is to be Created
        else if (ViewState["UserCreate"].ToString() == "create")
        {
            string varEmail = "";
            string varRoleName = Resources.MessageResource.BasicUserRole.ToString();
            if (txtEmail.Text == "")
            {
                varEmail = Resources.MessageResource.errMemshipCreateUserEmail.ToString();
            }
            else
            {
                varEmail = txtEmail.Text;
            }

            int roleid = objRole.Get_By_RoleName(varRoleName);
            int status;
            objOrganization = objOrganization.Get_Organization();

            objuser.Username = txtUsername.Text.ToString();
            objuser.Password = Resources.MessageResource.strDefaultPassword.ToString();
            objuser.Roleid = roleid;
            objuser.Orgid = objOrganization.Orgid;
            objuser.ADEnable = false;
            objuser.Enable = true;
            objuser.Createdatetime = DateTime.Now.ToString();
            status = objuser.Insert();
            if (status == 1)
            {
                // Create Mstatus field to send in Membership.CreateUser function as Out Variable for creating Membership User database
                MembershipCreateStatus Mstatus = default(MembershipCreateStatus);
                // Call Membership.CreateUser function to create Membership user
                Membership.CreateUser(txtUsername.Text.ToString().Trim(), Resources.MessageResource.strDefaultPassword.ToString(), varEmail, "Project Name", "Helpdesk", true, out Mstatus);
                // Call Roles.AddUserToRole Function to Add User To Role
                Roles.AddUserToRole(txtUsername.Text.ToString().Trim(), varRoleName);
                // Declare Local Variable Userid to fetch userid of newly created user

                // Create Object objUserLogin of UserLogin_mst()Class
                objuser = new UserLogin_mst();
                // Fetch userid of Newly created user and assign to local variable userid by calling function objUserLogin.Get_By_UserName
                requesterid = objuser.Get_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
                // If userid not equal to 0 then we get userid of Newly created user otherwise error Occured

                ContactInfo_mst objContactInfo = new ContactInfo_mst();
                objContactInfo.Userid = requesterid;
                objContactInfo.Emailid = varEmail;
                objContactInfo.Firstname = txtUsername.Text.ToString();
                objContactInfo.Lastname = txtUsername.Text.ToString();
                objContactInfo.Insert();

            }
        }
        #endregion
        #region If User is Not to be Created
        else if (ViewState["UserCreate"].ToString() == "notcreate")
        {
            FlagUserStatus = false;

        }
        #endregion

        #endregion

        MembershipUser User = Membership.GetUser();
        string userName;
        userName = User.UserName.ToString();
        if (FlagUserStatus == true)
        {

            objOrganization = objOrganization.Get_Organization();
            objuser = objuser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            ObjProblem.CreatedByid = objuser.Userid;
            ObjProblem.Requesterid = requesterid;
            ObjProblem.Categoryid = Convert.ToInt16(drpCategory.SelectedValue);
            ObjProblem.Subcategoryid = Convert.ToInt16(drpSubcategory.SelectedValue);

            ObjProblem.Priorityid = Convert.ToInt16(drpPriority.SelectedValue);
            ObjProblem.Statusid = Convert.ToInt16(drpStatus.SelectedValue);
            ObjProblem.Technicianid = Convert.ToInt16(drpTechnician.SelectedValue);
            ObjProblem.title = txtTitle.Text;
            ObjProblem.Description = txtDescription.Text;
            if (Convert.ToInt16(drpTechnician.SelectedValue) != 0)
            {
                ObjProblem.AssginedTime = DateTime.Now.ToString();
            }
//.........这里部分代码省略.........
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:101,代码来源:IncidentToProblem.aspx.cs


示例3: buttonadd_click

    protected void buttonadd_click(object sender, EventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            #region Find Userid of User who is Requesting to log a call

            #region If User Already Exist
            if (ViewState["UserCreate"].ToString() == "Exist")
            {
                objOrganization = objOrganization.Get_Organization();
                ObjUserLogin = ObjUserLogin.Get_UserLogin_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
                if (ObjUserLogin.Userid != 0)
                {
                    requesterid = ObjUserLogin.Userid;
                }
            }
            #endregion
            #region If New User is to be Created
            else if (ViewState["UserCreate"].ToString() == "create")
            {
                string varEmail = "";
                string varRoleName = Resources.MessageResource.BasicUserRole.ToString();
                if (txtEmail.Text == "")
                {
                    varEmail = Resources.MessageResource.errMemshipCreateUserEmail.ToString();
                }
                else
                {
                    varEmail = txtEmail.Text;
                }

                int roleid = objRole.Get_By_RoleName(varRoleName);
                int status;
                objOrganization = objOrganization.Get_Organization();

                objuser.Username = txtUsername.Text.ToString();
                objuser.Password = Resources.MessageResource.strDefaultPassword.ToString();
                objuser.Roleid = roleid;
                objuser.Orgid = objOrganization.Orgid;
                objuser.ADEnable = false;
                objuser.Enable = true;
                objuser.Createdatetime = DateTime.Now.ToString();
                status = objuser.Insert();
                if (status == 1)
                {
                    // Create Mstatus field to send in Membership.CreateUser function as Out Variable for creating Membership User database
                    MembershipCreateStatus Mstatus = default(MembershipCreateStatus);
                    // Call Membership.CreateUser function to create Membership user
                    Membership.CreateUser(txtUsername.Text.ToString().Trim(), Resources.MessageResource.strDefaultPassword.ToString(), varEmail, "Project Name", "Helpdesk", true, out Mstatus);
                    // Call Roles.AddUserToRole Function to Add User To Role
                    Roles.AddUserToRole(txtUsername.Text.ToString().Trim(), varRoleName);
                    // Declare Local Variable Userid to fetch userid of newly created user

                    // Create Object objUserLogin of UserLogin_mst()Class
                    objuser = new UserLogin_mst();
                    // Fetch userid of Newly created user and assign to local variable userid by calling function objUserLogin.Get_By_UserName
                    requesterid = objuser.Get_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
                    // If userid not equal to 0 then we get userid of Newly created user otherwise error Occured

                    ContactInfo_mst objContactInfo = new ContactInfo_mst();
                    objContactInfo.Userid = requesterid;
                    objContactInfo.Emailid = varEmail;
                    objContactInfo.Firstname = txtUsername.Text.ToString();
                    objContactInfo.Lastname = txtUsername.Text.ToString();
                    objContactInfo.Insert();

                }
            }
            #endregion
            #region If User is Not to be Created
            else if (ViewState["UserCreate"].ToString() == "notcreate")
            {
                // FlagUserStatus = false;

            }
            #endregion

            #endregion
            ObjChange.Active = true;

            ObjChange.Statusid = Convert.ToInt32(drpStatus.SelectedValue);
            ObjChange.Categoryid = Convert.ToInt32(drpCategory.SelectedValue);
            ObjChange.Subcategoryid = Convert.ToInt32(drpSubcategory.SelectedValue);
            ///ObjChange.Technician = "";
            ObjChange.Title = txtTitle.Text;
            ObjChange.Description = txtDescription.Text;
            ObjChange.Createdtime = DateTime.Now.ToString();
            ObjChange.Changetype = Convert.ToInt32(drpchangetype.SelectedValue);
            ObjChange.Approvalstatus = "Send For Approval";
            MembershipUser user = Membership.GetUser();
            string username = user.UserName.ToString();
            objOrganization = objOrganization.Get_Organization();
            ObjUserLogin = ObjUserLogin.Get_UserLogin_By_UserName(username, objOrganization.Orgid);
            int userid = Convert.ToInt32(ObjUserLogin.Userid);
            ObjChange.CreatedByID = userid;
            //////////change doneby meenakshi

            objservice = objservice.Get_By_id(Convert.ToInt32(drpservices.SelectedValue));
            if (objservice.servicename != null)
//.........这里部分代码省略.........
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:101,代码来源:CreateChangefromIncident.aspx.cs


示例4: BindDropTechnician

    protected void BindDropTechnician()
    {
        objRole = objRole.Get_RoleInfo_By_RoleName("technician");
        if (objRole.Roleid != 0)
        {
            int siteid = 0;
            int roleid;
            if (drpSite.SelectedValue != "") { siteid = Convert.ToInt32(drpSite.SelectedValue); }

            roleid = objRole.Roleid;
            if (siteid != 0 && roleid != 0)
            {
                colUser = objUser.Get_All_By_Role_Site(roleid, siteid);
                //meenakshi
                for (int i = 0; i < colUser.Count; i++)
                {
                    for (int j = i; j < colUser.Count; j++)
                    {

                        if (String.Compare(colUser[i].Username, colUser[j].Username) > 0)
                        {
                            UserLogin_mst obj = new UserLogin_mst();
                            obj = colUser[i];
                            colUser[i] = colUser[j];
                            colUser[j] = obj;

                        }
                    }

                }
                //end
                drpTechnician.DataTextField = "username";
                drpTechnician.DataValueField = "userid";
                drpTechnician.DataSource = colUser;
                drpTechnician.DataBind();
                ListItem item = new ListItem();
                item.Text = "All";
                item.Value = "0";
                drpTechnician.Items.Add(item);
                //item.Text = "-----------Select-----------";
                //item.Value = "0";
                //drpTechnician.Items.Add(item);
                drpTechnician.SelectedValue = "0";

            }
            else
            {

                colUser = objUser.Get_All_By_Role_Site(roleid, siteid);
                //meenakshi
                for (int i = 0; i < colUser.Count; i++)
                {
                    for (int j = i; j < colUser.Count; j++)
                    {

                        if (String.Compare(colUser[i].Username, colUser[j].Username) > 0)
                        {
                            UserLogin_mst obj = new UserLogin_mst();
                            obj = colUser[i];
                            colUser[i] = colUser[j];
                            colUser[j] = obj;

                        }
                    }

                }
                //end
                drpTechnician.DataTextField = "username";
                drpTechnician.DataValueField = "userid";
                drpTechnician.DataSource = colUser;
                drpTechnician.DataBind();
                ListItem item = new ListItem();
                item.Text = "All";
                item.Value = "0";
                drpTechnician.Items.Add(item);
                //item.Text = "-----------Select-----------";
                //item.Value = "0";
                //drpTechnician.Items.Add(item);
                drpTechnician.SelectedValue = "0";

            }

        }
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:84,代码来源:TechnicianPerformance.aspx.cs


示例5: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        // Save User to Database on Button Save click Event
        // Start
        objOrganization = objOrganization.Get_Organization();
            //Declare Local Variables - Flag,varRolename,FlagMembership
              int Flag;
              string varRoleName;
              bool FlagMembership;
              // Use Asp.Net Membership Validator Control Membership.ValidateUser to check User Exist in aspnet Database
                 FlagMembership = Membership.ValidateUser(txtUserName.Text.ToString().Trim(), txtPassword.Text.ToString().Trim());

             //  Create Object of UserLogin_mst Class to Check User Exist in Database UserLogin_mst table
                  UserLogin_mst objUserLogin = new UserLogin_mst();
             //  Declare local Variable Flag to Check Status User Exist in databse
                  Flag = objUserLogin.Get_By_UserName(txtUserName.Text.ToString().Trim(), objOrganization.Orgid );
             //  If User Does'nt exist in Database and in aspnet databse then flag value will 0 and FlagMembership value will be False
                 if (Flag == 0 && FlagMembership==false)
                {
                    // Declare status local variable
                    int status;
                    // Create Object objUserLogin of UserLogin_mst() Class to insert record in table
                    objUserLogin = new UserLogin_mst();
                    objUserLogin.Username = txtUserName.Text.ToString().Trim();
                    objUserLogin.Password = txtPassword.Text.ToString().Trim();
                    objUserLogin.Roleid = Convert.ToInt16(dropRole.SelectedValue);
                    objUserLogin.Orgid = objOrganization.Orgid ;
                    objUserLogin.ADEnable = false;
                    objUserLogin.Enable = true;
                    objUserLogin.Createdatetime = DateTime.Now.ToString();
                    // Call Insert function to insert record in UserLogin_mst table
                    // Check status whether Record inserted Successfully or Not,If status=1 then Success otherwise Operation Fail
                       status = objUserLogin.Insert();
                       if (status == 1)
                       {
                           // Declare local variable varEmail to fetch email of user from textbox
                              string varEmail;
                           //If Email field is Not Empty then Assign value to varEmail Local Variable
                           if (txtEmailId.Text != "")
                           {
                               varEmail = txtEmailId.Text.Trim();
                           }
                           // Else Assign value define in MessagesResources.resx file in errMemshipCreateUserEmail field
                           else
                           {
                               varEmail = Resources.MessageResource.errMemshipCreateUserEmail.ToString();
                           }
                           // Assign selected text from droprole down to  local variable field varRoleName
                           varRoleName = dropRole.SelectedItem.Text.ToString().Trim();
                           // Create Mstatus field to send in Membership.CreateUser function as Out Variable for creating Membership User database
                              MembershipCreateStatus Mstatus = default(MembershipCreateStatus);
                              // Call Membership.CreateUser function to create Membership user
                                 Membership.CreateUser(txtUserName.Text.ToString().Trim(), txtPassword.Text.ToString().Trim(), varEmail, "Project Name", "Helpdesk", true, out Mstatus);
                                // Call Roles.AddUserToRole Function to Add User To Role
                                Roles.AddUserToRole(txtUserName.Text.ToString().Trim(), varRoleName);
                                // Declare Local Variable Userid to fetch userid of newly created user
                                int userid;
                                // Create Object objUserLogin of UserLogin_mst()Class
                                  objUserLogin = new UserLogin_mst();
                                  // Fetch userid of Newly created user and assign to local variable userid by calling function objUserLogin.Get_By_UserName
                                  userid = objUserLogin.Get_By_UserName(txtUserName.Text.ToString().Trim(), objOrganization.Orgid );
                                  // If userid not equal to 0 then we get userid of Newly created user otherwise error Occured
                                    UserToSiteMapping objusertositemapping = new UserToSiteMapping();
                                    if (userid != 0)
                                    {
                                        // Create Object objContactInfo of ContactInfo_mst class to Store User Contact Information in Contact_info table
                                        ContactInfo_mst objContactInfo = new ContactInfo_mst();
                                        objContactInfo.Userid = userid;
                                        objContactInfo.Firstname = txtFname.Text.ToString().Trim();
                                        objContactInfo.Lastname = txtLname.Text.ToString().Trim();
                                        objContactInfo.Description = txtDesc.Text.ToString().Trim();
                                        objContactInfo.Empid = txtEmpId.Text;
                                        objContactInfo.Emailid = txtEmailId.Text.ToString().Trim();
                                        objContactInfo.Landline = txtLandline.Text.ToString().Trim();
                                        objContactInfo.Mobile = txtMobile.Text.ToString().Trim();
                                        objContactInfo.Siteid = Convert.ToInt16(DrpSite.SelectedValue);

                                        //if (DrpDepartment.SelectedItem.ToString() != null)
                                        //{
                                            objContactInfo.Deptid = Convert.ToInt16(DrpDepartment.SelectedValue);
                                        //}

                                        // Call objContactInfo.Insert function to Insert record in Contact_info table
                                        objContactInfo.Insert();
                                        // Show Message Operation perform successfully
                                           //lblMessage.Text = Resources.MessageResource.errDataSave.ToString();
                                        // Calling Function Clear() to Clear all controls on Form
                                           objusertositemapping.Userid = userid;
                                           objusertositemapping.Siteid = Convert.ToInt16(DrpSite.SelectedValue);
                                           objusertositemapping.Insert();
                                          Clear();
                                          Response.Redirect("~/admin/ViewUser.aspx");

                                    }
                                    else
                                    {
                                        // Show Message Error Occured due to some Reason
                                        lblMessage.Text = Resources.MessageResource.errOccured.ToString();
                                    }

//.........这里部分代码省略.........
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:101,代码来源:AddUser.aspx.cs


示例6: btnSolutionAdd_Click

    protected void btnSolutionAdd_Click(object sender, EventArgs e)
    {
        string userName;
        MembershipUser User = Membership.GetUser();
        userName = User.UserName.ToString();
        int userid;
        objOrganization = objOrganization.Get_Organization();
        objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);

        int Solutionid;
        ObjSolution.Title = txtTitle.Text.ToString();
        ObjSolution.Content=Editor.Text.ToString();
        ObjSolution.Topicid = Convert.ToInt16(drpTopic.SelectedValue);
        ObjSolution.Solution = drpSolutionType.SelectedValue;
        ObjSolution.Insert();
        Solutionid = ObjSolutionKeyword.Get_SolutionId();
        ObjSolutionKeyword.Keywords=txtKeywords.Text.ToString();
        ObjSolutionKeyword.Solutionid = Solutionid;
        ObjSolutionKeyword.Insert();
        ObjSolutionCreator.Solutionid = Solutionid;
        ObjSolutionCreator.Createdby = objUser.Userid;
        ObjSolutionCreator.Insert();
        objSentMailToUser.SentMailToPManager(Solutionid);
        Response.Redirect("ViewSolution.aspx?solutionid" + Solutionid);
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:25,代码来源:AddSolution.aspx.cs


示例7: btnMapped_Click

 protected void btnMapped_Click(object sender, EventArgs e)
 {
     //lblErrorMsg.Text = "";
     int flag = 0;
     foreach (GridViewRow gv in grdvwViewUser.Rows)
     {
         string gvIDs;
         RadioButton selectonebutton = (RadioButton)gv.FindControl("selectone");
         if (selectonebutton.Checked)
         {
             flag = 1;
             gvIDs = ((Label)gv.FindControl("lblUserID")).Text.ToString();
             userid = Convert.ToInt16(gvIDs);
             objUser = objUser.Get_By_id(userid);
             string username = objUser.Username.ToString();
             Session["username"] = username;
             Session["userid"] = userid;
             Session["flag"] = flag;
             Session["flag2"] = flag;
             break;
        }
        }
     string myScript;
     myScript = "<script language=javascript>javascript:refreshParent(); javascript:window.close();</script>";
     Page.RegisterClientScriptBlock("MyScript", myScript);
 }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:26,代码来源:SelectUser.aspx.cs


示例8: updatecomment

    public void updatecomment()
    {
        string userName;
        MembershipUser User = Membership.GetUser();

        solutionstatusid = Convert.ToInt32(Request.QueryString[0]);
        flag = Convert.ToInt32(Request.QueryString[1]);
        int userid;
        if (flag == 3)
        {
            string seeionsid = Session["SolutionId"].ToString();

            string[] str = seeionsid.Split(new char[] { ',' });
            foreach (string s in str)
            {
                if (s == "")
                {
                    break;
                }
                int solid = Convert.ToInt32(s);
                ObjSolution = ObjSolution.Get_By_id(solid);
                ObjSolution.Title = ObjSolution.Title;
                ObjSolution.Topicid = ObjSolution.Topicid;
                ObjSolution.Content = ObjSolution.Content;
                ObjSolution.Comments = txtcomments.Text;
                ObjSolution.SolutionStatus = solutionstatusid;
                ObjSolution.Update();

                userName = User.UserName.ToString();

                Objorganization = Objorganization.Get_Organization();
                objUser = objUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid);
                ObjSolutionCreator.Solutionid = solid;
                ObjSolutionCreator.LastUpdateBy = objUser.Userid;
                ObjSolutionCreator.Update();
            }
        }
        else
        {
            int solutionid = Convert.ToInt32(Request.QueryString[1]);

            ObjSolution = ObjSolution.Get_By_id(solutionid);
            ObjSolution.Title = ObjSolution.Title;
            ObjSolution.Topicid = ObjSolution.Topicid;
            ObjSolution.Content = ObjSolution.Content;
            ObjSolution.Comments = txtcomments.Text;
            ObjSolution.SolutionStatus = solutionstatusid;
            ObjSolution.Update();

            userName = User.UserName.ToString();

            Objorganization = Objorganization.Get_Organization();
            objUser = objUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid);
            ObjSolutionCreator.Solutionid = solutionid;
            ObjSolutionCreator.LastUpdateBy = objUser.Userid;
            ObjSolutionCreator.Update();
        }
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:58,代码来源:ApproveActions.aspx.cs


示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim();
        string statusString = "";
        int incidentid =Convert.ToInt16(Request.QueryString[0]);
        Objincident = Objincident.Get_By_id(incidentid);
        Objincidentstate = Objincidentstate.Get_By_id(incidentid);
        Objincidentresoution = Objincidentresoution.Get_By_id(incidentid);
        objstatus = objstatus.Get_By_id(Objincidentstate.Statusid);
        statusString = objstatus.Statusname.ToString();
         if (statusString.ToLower() == strStatusClose.ToLower())
        {
        lbltcktno.Text = Objincident.Incidentid.ToString();
        lblcreatedate.Text = Objincident.Createdatetime.ToString();

        if (Objincidentstate.AssignedTime != null)
        {
            lblstarttime.Text = Objincidentstate.AssignedTime.ToString();
        }
        lblendtime.Text = Objincident.Completedtime.ToString();
        Objcategory=Objcategory.Get_By_id(Objincidentstate.Categoryid);

        lblcomponenteffected.Text = Objcategory.CategoryName.ToString();
        lbldescription.Text = Objincident.Title.ToString();
        string bb = Objincidentresoution.Resolution.ToString();
           string stripped = Regex.Replace(bb,@"<(.|\n)*?>",string.Empty);
           lblresolution.Text = stripped.ToString();
        //bind data to data bound controls and do other stuff
           objUser = objUser.Get_By_id(Objincident.Requesterid);
           lblcustomer.Text = objUser.Username.ToString();
           objUser = objUser.Get_By_id(Objincidentstate.Technicianid);
           lblengineer.Text = objUser.Username.ToString();
           objstatus = objstatus.Get_By_id(Objincidentstate.Statusid);
           lblrcaresult.Text = objstatus.Statusname.ToString();
           }
        Response.Clear(); //this clears the Response of any headers or previous output
        Response.Buffer = true; //make sure that the entire output is rendered simultaneously

        ///
        ///Set content type to MS Excel sheet
        ///Use "application/msword" for MS Word doc files
        ///"application/pdf" for PDF files
        ///

        Response.ContentType = "application/vnd.ms-excel";
        StringWriter stringWriter = new StringWriter(); //System.IO namespace should be used

        HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);

        ///
        ///Render the entire Page control in the HtmlTextWriter object
        ///We can render individual controls also, like a DataGrid to be
        ///exported in custom format (excel, word etc)
        ///
        this.RenderControl(htmlTextWriter);
        Response.Write(stringWriter.ToString());
        Response.End();
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:58,代码来源:RCA.aspx.cs


示例10: BindDropSite

    protected void BindDropSite()
    {
        string userName = "";
        MembershipUser User = Membership.GetUser();
        if (User != null)
        {
            userName = User.UserName.ToString();
        }

        if (userName != "")
        {
            int userid;
            objOrganization = objOrganization.Get_Organization();
            objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            if (objUser.Userid != 0)
            {
                userid = objUser.Userid;
                colUserToSite = ObjUserToSite.Get_All_By_userid(userid);
                foreach (UserToSiteMapping obj in colUserToSite)
                {
                    int siteid;
                    Site_mst objSite1 = new Site_mst();
                    siteid = obj.Siteid;
                    objSite1 = objSite1.Get_By_id(siteid);
                    if (objSite1.Siteid != 0)
                    {
                        colSite.Add(objSite1);
                    }

                }

            }
            drpSite.DataTextField = "sitename";
            drpSite.DataValueField = "siteid";
            drpSite.DataSource = colSite;
            drpSite.DataBind();
            ListItem item = new ListItem();
            item.Text = "-------------Select-------------";
            item.Value = "0";
            drpSite.Items.Add(item);
            drpSite.SelectedValue = "0";

            //drpSite1.DataTextField = "sitename";
            //drpSite1.DataValueField = "siteid";
            //drpSite1.DataSource = colSite;
            //drpSite1.DataBind();
            //ListItem item1= new ListItem();
            //item1.Text = "-------------Select-------------";
            //item1.Value = "0";
            //drpSite1.Items.Add(item1);
            //drpSite1.SelectedValue = "0";

        }
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_HT,代码行数:54,代码来源:Default.aspx.cs


示例11: btnapprove_Click

    protected void btnapprove_Click(object sender, EventArgs e)
    {
        int userid=0;
        int incidentid = Convert.ToInt16(Session["incidentid"].ToString());
        if (incidentid != 0)
        {

            //objIncidentLog = objIncidentLog.Get_By_id(incidentid);
            //if (objIncidentLog.Incidentid != 0)
            //{
            //    objIncidentLog.Incidentid = incidentid;
            //    objIncidentLog.Incidentlog = txtcomments.Text;
            //    objIncidentLog.Update();

            //}
            //else
            //{
            //    objIncidentLog.Incidentid = incidentid;
            //    objIncidentLog.Incidentlog = txtcomments.Text;
            //    objIncidentLog.Insert();

            //}

        string userName="";
        MembershipUser User = Membership.GetUser();
        if (User != null)
        {
            userName = User.UserName.ToString();
        }

        if (userName != "")
        {

            objOrganization = objOrganization.Get_Organization();
            objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            if (objUser.Userid != 0)
            {
                userid = objUser.Userid;
            }
        }

            objIncidentLog.Incidentid = incidentid;
            objIncidentLog.Userid = userid;
            objIncidentLog.Incidentlog = txtcomments.Text;
            objIncidentLog.Insert();

            string myScript;
            myScript = "<script language=javascript>javascript:refreshParent(); javascript:window.close();</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);

        }
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_TerexBest,代码行数:52,代码来源:IncidentLog.aspx.cs


示例12: btnapprove_Click

    protected void btnapprove_Click(object sender, EventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            int userid = 0;
            int incidentid = Convert.ToInt32(Session["incidentid"].ToString());
            if (incidentid != 0)
            {

                string userName = "";
                MembershipUser User = Membership.GetUser();
                if (User != null)
                {
                    userName = User.UserName.ToString();
                }

                if (userName != "")
                {

                    objOrganization = objOrganization.Get_Organization();
                    objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
                    if (objUser.Userid != 0)
                    {
                        userid = objUser.Userid;
                    }
                }

                objIncidentLog.Incidentid = incidentid;
                objIncidentLog.Userid = userid;
                objIncidentLog.Incidentlog = txtcomments.Text;
                objIncidentLog.Insert();

                string myScript;
                myScript = "<script language=javascript>javascript:window.close();</script>";
                Page.RegisterClientScriptBlock("MyScript", myScript);

            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:47,代码来源:IncidentLog1.aspx.cs


示例13: btnSolutionAdd_Click

    protected void btnSolutionAdd_Click(object sender, EventArgs e)
    {
        ///Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
        string userName;
        MembershipUser User = Membership.GetUser();
        userName = User.UserName.ToString();
        int userid;
        objOrganization = objOrganization.Get_Organization();
        objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);

        int Solutionid;
        ObjSolution.Title = txtTitle.Text.ToString();
        ObjSolution.Content=Editor.Text.ToString();
        ObjSolution.Topicid = Convert.ToInt32(drpTopic.SelectedValue);
        ObjSolution.Solution = drpSolutionType.SelectedValue;
        ObjSolution.Insert();
        Solutionid = ObjSolutionKeyword.Get_SolutionId();
        ObjSolutionKeyword.Keywords=txtKeywords.Text.ToString();
        ObjSolutionKeyword.Solutionid = Solutionid;
        ObjSolutionKeyword.Insert();
        ObjSolutionCreator.Solutionid = Solutionid;
        ObjSolutionCreator.Createdby = objUser.Userid;
        ObjSolutionCreator.Insert();
        objSentMailToUser.SentMailToPManager(Solutionid);
        Response.Redirect("ViewSolution.aspx?solutionid" + Solutionid);
         }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:36,代码来源:AddSolution.aspx.cs


示例14: ShowResolution

    protected void ShowResolution()
    {
        IncidentResolution objIncidentResolution = new IncidentResolution();
        #region Declaration of Dynamic Table,and Placeholder
        PlaceHolderResolution.Controls.Clear();
        Table tbl = new Table();
        PlaceHolderResolution.Controls.Add(tbl);
        int hdwidth = 1500;
        int height = 5;
        #endregion

        int incidentid = Convert.ToInt32(Session["incidentid"].ToString());

        #region Get Collection of Log From IncidentLog table via incidentid
        colIncidentResolution = objIncidentResolution.Get_All_By_incidentid(incidentid);
        if (colIncidentResolution.Count == 0)
        {

            TableRow tabRow3 = new TableRow();
            TableCell tbCell3 = new TableCell();
            tbCell3.Width = hdwidth;
            tbCell3.Height = height;
            Label lbl3 = new Label();
            lbl3.Text = "No Record Found";
            lbl3.Font.Size = FontUnit.Smaller;
            tbCell3.Controls.Add(lbl3);
            tabRow3.Cells.Add(tbCell3);
            tbl.Rows.Add(tabRow3);

        }
        foreach (IncidentResolution obj in colIncidentResolution)
        {

            #region Fetch Username on the basis of Operationownerid,by calling Get_By_id() function of Userlogin_mst Instance
            string username;
            objUser = objUser.Get_By_id(obj.Userid);
            username = objUser.Username.ToString();
            #endregion
            #region Declaration of Tablerow,TableCell and lable object
            TableRow tabRow = new TableRow();
            TableCell tbCell = new TableCell();
            tbCell.Width = hdwidth;
            Label lbl = new Label();
            #endregion
            #region Print Each Operation Performed by User
            lbl.Font.Bold = true;
            lbl.Text = "&nbsp;&nbsp;" + username + "&nbsp;&nbsp;&nbsp;&nbsp;said on&nbsp;&nbsp;&nbsp;&nbsp;" + obj.Lastupdatetime.ToString();
            #endregion
            #region Fix background color of Row

            tabRow.BackColor = System.Drawing.Color.Lavender;

            #endregion
            #region Add label,cell,and Row to tabel
            tbCell.Controls.Add(lbl);
            tabRow.Cells.Add(tbCell);
            tbl.Rows.Add(tabRow);
            #endregion

            #region Declaration of local variables,tablerow,tablecell and label
            TableRow tabRowInner = new TableRow();
            TableCell tbCellInner = new TableCell();
            tbCellInner.Width = hdwidth;
            Label lblinner = new Label();
            lblinner.Font.Size = FontUnit.Smaller;
            #endregion

            #region Print Each Operation Performed by User
            lblinner.Font.Bold = true;
            lblinner.Text = "&nbsp;&nbsp;&nbsp;&nbsp;" + obj.Resolution.ToString();
            #endregion

            #region Label,cells and rows to Tabel of inner loop
            tabRowInner.BackColor = System.Drawing.Color.White;
            tbCellInner.Controls.Add(lblinner);
            tabRowInner.Cells.Add(tbCellInner);
            tbl.Rows.Add(tabRowInner);
            #endregion

        }

        #endregion
    }
开发者ID:progressiveinfotech,项目名称:PRO_FY13_40_Helpdesk-Support-and-Customization_EIH,代码行数:83,代码来源:IncidentRequestUpdate.aspx.cs


示例15: grdvwRequest_RowDataBound

    protected void grdvwRequest_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            System.Drawing.ColorConverter colConvert = new ColorConverter();
            BLLCollection<ColorScheme_mst> colColor = new BLLCollection<ColorScheme_mst>();
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                #region Autogenerate Serial number
                Label lblSerial = (Label)e.Row.FindControl("lblSerial");
                lblSerial.Text = i.ToString();
                i++;
                #endregion

                int TotalTimeSpentonCall;
                int TotalResolutionTime;

                int varIncidentid = Convert.ToInt32(((Label)e.Row.FindControl("incidentid")).Text.ToString());
                string varCreateDatetime = e.Row.Cells[9].Text;
                string varStatusOpen = Resources.MessageResource.strStatusOpen.ToString();
                string varStatusClose = Resources.MessageResource.strStatusClose.ToString();
                string varStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString();

                string varStatusResolved = Resources.MessageResource.strStatusResolved.ToString();

                #region Bind Data Row at Run time with requesterid to Requester name
                int requesterid = Convert.ToInt32(e.Row.Cells[3].Text);
                //objUser = objUser.Get_By_id(requesterid);
                objContactmst = objContactmst.Get_By_id(requesterid);
                //if (objUser.Userid != 0)
                //{
                //    e.Row.Cells[3].Text = objUser.Username.ToString();
                //    //e.Row.Cells[3].Text = objContactmst.Firstname.ToString();
                //}
                //else { e.Row.Cells[3].Text = ""; }
                //if (objUser.Userid != 0)
                //{
                //e.Row.Cells[3].Text = objUser.Username.ToString();
                if (objContactmst.Firstname != null)
                {
                    e.Row.Cells[3].Text = objContactmst.Firstname.ToString();
                }
                // }else { e.Row.Cells[3].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with Createdbyid to Created by name
                int createdbyid = Convert.ToInt32(e.Row.Cells[4].Text);
                objUser = objUser.Get_By_id(createdbyid);
                if (objUser.Userid != 0)
                {
                    e.Row.Cells[4].Text = objUser.Username.ToString();
                }
                else { e.Row.Cells[4].Text = ""; }
                #endregion

                #region Bind Datarow at Run Time with technicianid to technician name
                int technicianid = Convert.ToInt32(e.Row.Cells[5].Text);
                objUser = objUser.Get_By_id(technicianid);
                if (objUser.Userid != 0)
                {
         

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UserManager类代码示例发布时间:2022-05-24
下一篇:
C# UserLogin类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap