コード例 #1
0
    protected void GetUserDetail()
    {
        string         userName = "";
        MembershipUser User     = Membership.GetUser();

        if (User != null)
        {
            userName         = User.UserName.ToString();
            txtUsername.Text = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            objOrganization = objOrganization.Get_Organization();
            objUser         = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);

            if (objUser.Userid != 0)
            {
                ContactInfo_mst objConInfo = new ContactInfo_mst();
                userid = objUser.Userid;
                IncidentToAsset(userid);
                objConInfo          = objConInfo.Get_By_id(userid);
                txtEmail.Text       = objConInfo.Emailid;
                txtassignasset.Text = compname;
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {///Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         //lblUser.Text = Session["User"].ToString();
         if (!IsPostBack)
         {
             MembershipUser User = Membership.GetUser();
             objOrganization = objOrganization.Get_Organization();
             int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
             if (userid != 0)
             {
                 objContact   = objContact.Get_By_id(userid);
                 lblUser.Text = objContact.Firstname + "  " + objContact.Lastname;
             }
         }
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     //lblUser.Text = Session["User"].ToString();
     if (!IsPostBack)
     {
         MembershipUser User = Membership.GetUser();
         objOrganization = objOrganization.Get_Organization();
         int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
         if (userid != 0)
         {
             objContact   = objContact.Get_By_id(userid);
             lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
         }
         //added by lalit to view Mail link only to SDE. checking here SDE is logged on.
         if (Roles.IsUserInRole(User.UserName.ToString(), "SDE"))
         {
             trautocall.Visible = true;
             //trRejectedcall.Visible = true;
         }
         if (Roles.IsUserInRole(User.UserName.ToString(), "admin"))
         {
             //trautocall.Visible = true;
             trRejectedcall.Visible = true;
         }
         //if (Roles.IsUserInRole(User.UserName.ToString(), "SDE"))
         //{
         //    //trautocall.Visible = true;
         //    trRejectedcall.Visible = true;
         //}
     }
 }
コード例 #4
0
    public void SentmailTechnician(int technicianid, int incidentid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber  = Resources.MessageResource.strContactNumber.ToString();

        objIncident       = objIncident.Get_By_id(incidentid);
        objSite           = objSite.Get_By_id(objIncident.Siteid);
        objIncidentStates = objIncidentStates.Get_By_id(incidentid);
        objPriority       = objPriority.Get_By_id(objIncidentStates.Priorityid);
        objUser           = objUser.Get_By_id(objIncident.Requesterid);
        objtech           = objtech.Get_By_id(technicianid);
        objSDE            = objSDE.Get_By_id(objIncident.Createdbyid);
        objC_info         = objC_info.Get_By_id(technicianid);
        objUserInfo       = objUserInfo.Get_By_id(objIncident.Requesterid);

        if (objC_info.Emailid != null)
        {
            obj.To         = objC_info.Emailid;
            obj.From       = Resources.MessageResource.strAdminEmail.ToString();
            obj.Subject    = " New Call Assigned to you. Ticket id : " + incidentid;
            obj.Body       = "Dear&nbsp;" + objtech.Username + "," + "<br/>  A Call with the following details have been assigned to you.<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUser.Username + "<br/><b>Mobile No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objUserInfo.Mobile + "<br/><b>Landline No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objUserInfo.Landline + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive&nbsp;&nbsp;&nbsp;:</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            if (!IsPostBack)
            {
                MembershipUser User = Membership.GetUser();
                objOrganization = objOrganization.Get_Organization();
                int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
                if (userid != 0)
                {
                    string userName;
                    userName = User.UserName.ToString();
                    if (Roles.IsUserInRole(userName, "admin"))
                    {
                        panel1.Visible = true;
                    }
                    objContact   = objContact.Get_By_id(userid);
                    lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
                    //  Bind_Tree();

                    BindRepeater();
                }
            }
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    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";
    }
コード例 #7
0
    public void SentMailToTechnicianForProblemCall(int problemid, int userid)
    {
        string      strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string      strContactNumber  = Resources.MessageResource.strContactNumber.ToString();
        Problem_mst objProblem        = new Problem_mst();

        objUser = objUser.Get_By_id(userid);
        ContactInfo_mst objCont_info = new ContactInfo_mst();

        objCont_info = objCont_info.Get_By_id(objUser.Userid);
        objProblem   = objProblem.Get_By_id(problemid);
        objPriority  = objPriority.Get_By_id(objProblem.Priorityid);
        UserLogin_mst objReq = new UserLogin_mst();

        objReq = objReq.Get_By_id(objProblem.Requesterid);
        ContactInfo_mst objReqCont = new ContactInfo_mst();

        objReqCont = objReqCont.Get_By_id(objReq.Userid);
        objSDE     = objSDE.Get_By_id(objProblem.CreatedByid);

        if (objCont_info.Emailid != null)
        {
            obj.To         = objCont_info.Emailid;
            obj.From       = Resources.MessageResource.strAdminEmail.ToString();
            obj.Subject    = " New Problem Call Assigned to you. Problem Id : " + problemid;
            obj.Body       = "Dear&nbsp;" + objUser.Username + "," + "<br/>  A Call with the following details have been assigned to you.<br/><br/><b>Problem Details : </b> <br/><br/><b>Problem Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.ProblemId + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.title + " <br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objProblem.CreateDatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReq.Username + "<br/><b>Mobile No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objReqCont.Mobile + "<br/><b>Landline No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objReqCont.Landline + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqCont.Emailid + "<br/><b>Service Desk Executive&nbsp;&nbsp;&nbsp;:</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();
        }
    }
コード例 #8
0
 protected void txtUsername_TextChanged(object sender, EventArgs e)
 {
     #region Find Userid of User who is Requesting to log a call
     /////Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         objOrganization = objOrganization.Get_Organization();
         ObjUserLogin    = ObjUserLogin.Get_UserLogin_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
         if (ObjUserLogin.Userid == 0)
         {
             string myScript;
             myScript = "<script language=javascript>function __doPostBack(eventTarget, eventArgument){var theForm = document.forms['aspnetForm'];  if (theForm){  theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit(); }} var Flag= confirm('User Does not Exist,Do You Want to Create User');if(Flag==true){ __doPostBack('callPostBack', 'create');}if(Flag==false){ __doPostBack('callPostBack', 'notcreate');}</script>";
             Page.RegisterClientScriptBlock("MyScript", myScript);
         }
         else
         {
             ViewState["UserCreate"] = "Exist";
             ContactInfo_mst objCont = new ContactInfo_mst();
             objCont       = objCont.Get_By_id(ObjUserLogin.Userid);
             txtEmail.Text = objCont.Emailid;
         }
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
     #endregion
 }
コード例 #9
0
 protected void Page_Load(object sender, EventArgs e)
 {//Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         if (!IsPostBack)
         {
             MembershipUser User = Membership.GetUser();
             objOrganization = objOrganization.Get_Organization();
             int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
             if (userid != 0)
             {
                 objContact   = objContact.Get_By_id(userid);
                 lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
             }
         }
         XmlDataSource ds = new XmlDataSource();
         ds.EnableCaching     = false;
         ds.DataFile          = Server.MapPath("../Files/Admin.xml");
         TreeView1.DataSource = ds;
         TreeView1.DataBind();
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }
コード例 #10
0
 //function to check user exist or not
 protected void CheckUserExist()
 {
     lblerrmsg.Text = "";
     // BindDropSite();
     // BindDropDept();
     #region Find Userid of User who is Requesting to log a call
     objOrganization = objOrganization.Get_Organization();
     objUser         = objUser.Get_UserLogin_By_UserName(txtUsername.Text.Trim().ToString().Trim(), objOrganization.Orgid);
     int usrid    = Convert.ToInt16(objUser.Userid);
     int tempuser = 0;
     if (objUser.Userid == 0)
     {
         string myScript;
         tempuser = 1;
         myScript = "<script language=javascript>function __doPostBack(eventTarget, eventArgument){var theForm = document.forms['aspnetForm'];  if (theForm){  theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit(); }} var Flag= confirm('User Does not Exist,Do You Want to Create User');if(Flag==true){ __doPostBack('callPostBack', 'create');}if(Flag==false){ __doPostBack('callPostBack', 'notcreate');}</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         Session["tempuser"] = tempuser;
         //txtassignasset.Text = "";
     }
     else
     {
         IncidentToAsset(usrid);
         ContactInfo_mst objConInfo = new ContactInfo_mst();
         objConInfo    = objConInfo.Get_By_id(usrid);
         txtEmail.Text = objConInfo.Emailid;
         //txtassignasset.Text = assetid.ToString();
         //txtassignasset.Text = compname;
         Session["assignassetid"] = assetid;
         Session["UserCreate"]    = "Exist";
     }
     string username1 = txtUsername.Text.Trim().ToString();
     Session["Username"] = username1;
     Session["Email"]    = txtEmail.Text;
     #endregion
 }
コード例 #11
0
    protected void GetUserDetail()
    {
        string         userName = "";
        MembershipUser User     = Membership.GetUser();

        if (User != null)
        {
            userName         = User.UserName.ToString();
            txtUsername.Text = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            objOrganization = objOrganization.Get_Organization();
            objUser         = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            //objRole = objRole.Get_By_id(roleid);
            if (objUser.Userid != 0)
            {
                ContactInfo_mst objConInfo = new ContactInfo_mst();
                userid = objUser.Userid;
                IncidentToAsset(userid);
                objConInfo          = objConInfo.Get_By_id(userid);
                txtEmail.Text       = objConInfo.Emailid;
                txtassignasset.Text = compname;
                //priorityid = Convert.ToInt32(objConInfo.userpriority);
                //BindDropPriority(int priorityid);

                //ContactInfo_mst objcnt = new ContactInfo_mst();
                //if (objRole.roleid != 1)
                //{

                if (objConInfo.userpriority == 1)
                {
                    priorityid = objPriority.Get_By_PriorityName("High");
                }
                else
                {
                    priorityid = objPriority.Get_By_PriorityName("Medium");
                }
                //}
                Priority_mst objP = new Priority_mst();
                objP = objPriority.Get_By_id(priorityid);
                colPriority.Add(objP);
                drpPriority.DataTextField  = "name";
                drpPriority.DataValueField = "priorityid";
                drpPriority.DataSource     = colPriority;
                drpPriority.DataBind();
            }
        }
    }
コード例 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MembershipUser User = Membership.GetUser();
         objOrganization = objOrganization.Get_Organization();
         int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
         if (userid != 0)
         {
             objContact   = objContact.Get_By_id(userid);
             lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
         }
     }
 }
コード例 #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Get Current User and his Role
        MembershipUser User = Membership.GetUser();
        objOrganization = objOrganization.Get_Organization();
        int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
        if (userid != 0)
        {
            objContact   = objContact.Get_By_id(userid);
            lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
        }


        #endregion
    }
コード例 #14
0
 protected void Page_Load(object sender, EventArgs e)
 {///Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         //lblUser.Text = Session["User"].ToString();
         if (!IsPostBack)
         {
             MembershipUser User = Membership.GetUser();
             objOrganization = objOrganization.Get_Organization();
             int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
             if (userid != 0)
             {
                 objContact   = objContact.Get_By_id(userid);
                 lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
             }
             //added by lalit to view Mail link only to SDE. checking here SDE is logged on.
             string AutoCalls = Resources.MessageResource.strAutoCalls.ToString();
             if (Roles.IsUserInRole(User.UserName.ToString(), "SDE"))
             {
                 if (AutoCalls == "1")
                 {
                     trautocall.Visible     = true;
                     trRejectedcall.Visible = true;
                 }
             }
             if (Roles.IsUserInRole(User.UserName.ToString(), "admin"))
             {
                 //trautocall.Visible = true;
                 if (AutoCalls == "1")
                 {
                     trRejectedcall.Visible = true;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }
コード例 #15
0
    protected void BindIncidentToProblem()
    {
        if (Session["IncidentToProblem"] != null)
        {
            int incidentid = Convert.ToInt32(Session["IncidentToProblem"].ToString());

            Incident_mst   objIncident       = new Incident_mst();
            IncidentStates objIncidentStates = new IncidentStates();
            objIncident       = objIncident.Get_By_id(incidentid);
            objIncidentStates = objIncidentStates.Get_By_id(incidentid);
            objuser           = objuser.Get_By_id(objIncident.Requesterid);
            if (objIncidentStates.Priorityid != 0)
            {
                drpPriority.SelectedValue = Convert.ToString(objIncidentStates.Priorityid);
            }
            if (objIncidentStates.Categoryid != 0)
            {
                drpCategory.SelectedValue = Convert.ToString(objIncidentStates.Categoryid);
                BindDropSubCategory();
            }


            if (objIncidentStates.Subcategoryid != 0)
            {
                drpSubcategory.SelectedValue = Convert.ToString(objIncidentStates.Subcategoryid);
            }
            if (objIncidentStates.Technicianid != 0)
            {
                drpTechnician.SelectedValue = Convert.ToString(objIncidentStates.Technicianid);
            }
            txtDescription.Text = objIncident.Description;
            txtTitle.Text       = objIncident.Title;
            if (objuser.Userid != 0)
            {
                ContactInfo_mst objInfo = new ContactInfo_mst();
                objInfo                 = objInfo.Get_By_id(objuser.Userid);
                txtUsername.Text        = objuser.Username;
                txtEmail.Text           = objInfo.Emailid;
                ViewState["UserCreate"] = "Exist";
            }
        }
    }
コード例 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MembershipUser User = Membership.GetUser();
            objOrganization = objOrganization.Get_Organization();
            int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
            if (userid != 0)
            {
                objContact   = objContact.Get_By_id(userid);
                lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
            }
        }
        XmlDataSource ds = new XmlDataSource();

        ds.EnableCaching     = false;
        ds.DataFile          = Server.MapPath("../Files/Admin.xml");
        TreeView1.DataSource = ds;
        TreeView1.DataBind();
    }
コード例 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MembershipUser User = Membership.GetUser();
         objOrganization = objOrganization.Get_Organization();
         int userid = objUser.Get_By_UserName(User.UserName.ToString(), objOrganization.Orgid);
         if (userid != 0)
         {
             string userName;
             userName = User.UserName.ToString();
             if (Roles.IsUserInRole(userName, "admin"))
             {
                 panel1.Visible = true;
             }
             objContact   = objContact.Get_By_id(userid);
             lblUser.Text = objContact.Firstname + "&nbsp;&nbsp;" + objContact.Lastname;
         }
     }
     Bind_Tree();
 }
コード例 #18
0
    public void SentMailToSDM(int siteid, int incidentid, int requesterid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber  = Resources.MessageResource.strContactNumber.ToString();
        int    FlagUser;
        string varRole = Resources.MessageResource.strSDMRole.ToString();
        int    roleid;

        roleid  = objRole.Get_By_RoleName(varRole);
        colUser = objUser.Get_All_By_Role(roleid);
        foreach (UserLogin_mst objusr in colUser)
        {
            FlagUser = objUserToSiteMapping.Get_By_Id(objusr.Userid, siteid);
            if (FlagUser != 0)
            {
                objIncident       = objIncident.Get_By_id(incidentid);
                objSite           = objSite.Get_By_id(objIncident.Siteid);
                objIncidentStates = objIncidentStates.Get_By_id(incidentid);
                objPriority       = objPriority.Get_By_id(objIncidentStates.Priorityid);

                UserLogin_mst obju   = new UserLogin_mst();
                UserLogin_mst objReq = new UserLogin_mst();
                obju      = obju.Get_By_id(objUserToSiteMapping.Userid);
                objC_info = objC_info.Get_By_id(objusr.Userid);
                objReq    = objReq.Get_By_id(requesterid);
                ContactInfo_mst objReqContInfo = new ContactInfo_mst();
                objReqContInfo = objReqContInfo.Get_By_id(objReq.Userid);

                obj.From       = Resources.MessageResource.strAdminEmail.ToString();
                obj.To         = objC_info.Emailid;
                obj.Subject    = "High Priority Call. Ticket Id: " + incidentid;
                obj.Body       = "Dear Sir/Madam,<br/>High Priority Call has been logged, please find below the Complaint  details .<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReq.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqContInfo.Emailid + "<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
                obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
                obj.SentMail();
            }
        }
    }
コード例 #19
0
    public void SentmailUser(int userid, int incidentid, string status)
    {
        objIncident = objIncident.Get_By_id(incidentid);
        //added by lalit 02 nov to get resolution and show it to user when call closed mail goes to user
        objIncidentResolution = objIncidentResolution.Get_By_id(incidentid);
        //end
        objSite           = objSite.Get_By_id(objIncident.Siteid);
        objAreaManager    = objAreaManager.Get_By_id(objSite.Siteid);
        objIncidentStates = objIncidentStates.Get_By_id(incidentid);
        objPriority       = objPriority.Get_By_id(objIncidentStates.Priorityid);
        objUser           = objUser.Get_By_id(objIncident.Requesterid);
        objC_info         = objC_info.Get_By_id(userid);
        objtech           = objtech.Get_By_id(objIncidentStates.Technicianid);
        colemailid        = objemail.Get_All_userid(userid);
        string strStatusOpen     = Resources.MessageResource.strStatusOpen.ToString();
        string strStatusClose    = Resources.MessageResource.strStatusClose.ToString();
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber  = Resources.MessageResource.strContactNumber.ToString();

        if (strStatusOpen.ToLower() == status.ToLower())
        {
            foreach (UserEmail obj1 in colemailid)
            {
                if (obj1.Emailid != null)
                {
                    obj.From    = Resources.MessageResource.strAdminEmail.ToString();
                    obj.To      = obj1.Emailid;
                    obj.CC      = objAreaManager.Email;
                    obj.Subject = "Call Logged. Ticket Id : " + incidentid;
                    obj.Body    = "Dear " + objC_info.Firstname + ",<br/><br/> Thank you for contacting IT Service desk, please find below the new Ticket Id details for your future reference.<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + incidentid + "<br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objIncident.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objPriority.Name + "<br/><b>Username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + objUser.Username + "<br/><b>EstimatedResolutionTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                  + GetResolutionTimeInHours(objIncident.Slaid)
                                  + "<br/><b>Email Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "

                                  + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at " + strContactNumber + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> " + strYourSinscerely + "</b>";
                    obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
                    obj.SentMail();
                    string varPriority = Resources.MessageResource.strPriorityHigh.ToString();
                    if (objPriority.Priorityid != 0)
                    {
                        if (objPriority.Name.ToLower() == varPriority.ToLower())
                        {
                            SentMailToSDM(objSite.Siteid, incidentid, objUser.Userid);
                        }
                    }
                }
            }
            //if (objC_info.Emailid != null)
            //{
            //    obj.From = Resources.MessageResource.strAdminEmail.ToString();
            //    obj.To = objC_info.Emailid;
            //    obj.Subject = " New Call Logged. Ticket Id : " + incidentid;
            //    obj.Body = "Dear User,<br/> Thank you for contacting Service desk, please find below the Ticket Id details for your future reference.<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUser.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objC_info.Emailid + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            //    obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            //   //obj.SentMail();
            //    string varPriority = Resources.MessageResource.strPriorityHigh.ToString();
            //    if (objPriority.Priorityid != 0)
            //    {
            //        if (objPriority.Name.ToLower() == varPriority.ToLower())
            //        {
            //            SentMailToSDM(objSite.Siteid, incidentid, objUser.Userid);
            //        }
            //    }
            //}
        }
        if (strStatusClose.ToLower() == status.ToLower())
        {
            foreach (UserEmail obj1 in colemailid)
            {
                if (obj1.Emailid != null)
                {
                    int    id = Convert.ToInt16(objIncident.Incidentid);
                    string varServerName1;
                    string varfeedbackmode;
                    varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString();
                    //added by lalit to check feedback mode. feedback should add in mail or not.
                    //fetching value from resouce file which is from appsettting page.
                    varfeedbackmode = Resources.MessageResource.UserFeedbackmode.ToString();
                    string url11;
                    url11 = "http://" + varServerName1 + "/" + getpath() + "/LoginPageAccess/CustomerFeedback.aspx?userid=" + userid + "&Clid=" + objIncident.Incidentid;
                    //url11 = "../LoginPageAccess/CustomerFeedback.aspx?userid=" + userid + "&Clid=" + objIncident.Incidentid;
                    if (objC_info.Emailid != null)
                    {
                        // string url;
                        //    url = "<a  href=" + url11 + "&userid=" + objC_info.Firstname + " ' onclick=window.open()>Your Feedback</a>";
                        string url = "<a  href=" + url11 + " ' onclick=window.open()>Your Feedback</a>";
                        obj.From    = Resources.MessageResource.strAdminEmail.ToString();
                        obj.To      = obj1.Emailid;
                        obj.CC      = objAreaManager.Email;
                        obj.Subject = "Call Closed Ticket id : " + incidentid;
                        //added by lalit
                        if (varfeedbackmode == "0") //0 means default mode where user will not recieve link in mail to give feedback
                        {
                            obj.Body = "Dear " + objC_info.Firstname
                                       + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by&nbsp;<b>"
                                       + objtech.Username + "</b>&nbsp;on&nbsp;<b>"
                                       + objIncident.Completedtime + ".<br/><br/></b>We are pleased to confirm that the Service Call reported by you has been attended and resolved, should there be any further questions or queries, please do not hesitate to contact the Service Desk." + "<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + incidentid + "<br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;:</b> "
                                       + objIncident.Createdatetime + "<br/><b>Closed Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Completedtime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Description + "<br/><b>Resolution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncidentResolution.Resolution + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objPriority.Name + "<br/><b>Username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objUser.Username + "<br/><b>Email Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at "
                                       + strContactNumber + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>"
                                       + strYourSinscerely + "</b>";
                        }
                        else
                        {
                            obj.Body = "Dear " + objC_info.Firstname
                                       + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by&nbsp;<b>"
                                       + objtech.Username + "</b>&nbsp;on&nbsp;<b>"
                                       + objIncident.Completedtime + ".<br/><br/></b>We are pleased to confirm that the Service Call reported by you has been attended and resolved, should there be any further questions or queries, please do not hesitate to contact the Service Desk." + "<br/><br/><b>Incident Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + incidentid + "<br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;:</b> "
                                       + objIncident.Createdatetime + "<br/><b>Closed Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Completedtime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncident.Description + "<br/><b>Resolution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objIncidentResolution.Resolution + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objPriority.Name + "<br/><b>Username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objUser.Username + "<br/><b>Email Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> "
                                       + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at "
                                       + strContactNumber + ".<br/><br/>To give feedback click on "
                                       + url + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>"
                                       + strYourSinscerely + "</b>";
                        }
                        obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
                        obj.SentMail();
                    }
                }
            }
            //int id = Convert.ToInt16(objIncident.Incidentid);
            //string varServerName1;
            //varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString();
            //// varServerName = "10.80.0.15";
            //string url11;
            //url11 = "http://" + varServerName1 + "/BESTN/LoginPageAccess/CustomerFeedback.aspx?incident=" + id;
            //if (objC_info.Emailid != null)
            //{
            //    string url;
            //    url = "<a  href=" + url11 + "&userid=" + objC_info.Firstname + " ' onclick=window.open()>Your Feedback</a>";
            //    obj.From = Resources.MessageResource.strAdminEmail.ToString();
            //    obj.To = objC_info.Emailid;
            //    obj.Subject = "Call Closed Ticket id : " + incidentid;
            //    obj.Body = "Dear User,<br/> <b>Complaint Status:</b>Problem solved and call closed by&nbsp;<b>" + objtech.Username + "</b>&nbsp;on&nbsp;<b>" + objIncident.Completedtime + "</b>.We are pleased to inform you that your reported Service Call has been attended and problem solved as informed by our engineer.<br/>Should there be any further questions or queries, please do not hesitate to contact the Service Desk on 0120 4393941, quoting your Ticket Reference Number.   " + "<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "</br><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objUser.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objC_info.Emailid + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Your Feedback</b><br/><br/>" + url + "<br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            //    obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            //   // obj.SentMail();
            //}
        }
    }
    protected void GetUserDetail()
    {
        string userName = "";
        MembershipUser User = Membership.GetUser();
        if (User != null)
        {
            userName = User.UserName.ToString();
            txtUsername.Text = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            objOrganization = objOrganization.Get_Organization();
            objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);

            if (objUser.Userid != 0)
            {
                ContactInfo_mst objConInfo = new ContactInfo_mst();
                userid = objUser.Userid;
                IncidentToAsset(userid);
                objConInfo = objConInfo.Get_By_id(userid);
                txtEmail.Text = objConInfo.Emailid;
                txtassignasset.Text = compname;

            }
        }
    }
    public void SentMailToSDM(int siteid, int incidentid, int requesterid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber = Resources.MessageResource.strContactNumber.ToString();
        int FlagUser;
        string varRole = Resources.MessageResource.strSDMRole.ToString();
        int roleid;
        roleid = objRole.Get_By_RoleName(varRole);
        colUser = objUser.Get_All_By_Role(roleid);
        foreach (UserLogin_mst objusr in colUser)
        {

            FlagUser = objUserToSiteMapping.Get_By_Id(objusr.Userid, siteid);
            if (FlagUser != 0)
            {
                objIncident = objIncident.Get_By_id(incidentid);
                objSite = objSite.Get_By_id(objIncident.Siteid);
                objIncidentStates = objIncidentStates.Get_By_id(incidentid);
                objPriority = objPriority.Get_By_id(objIncidentStates.Priorityid);

                UserLogin_mst obju = new UserLogin_mst();
                UserLogin_mst objReq = new UserLogin_mst();
                obju = obju.Get_By_id(objUserToSiteMapping.Userid);
                objC_info = objC_info.Get_By_id(objusr.Userid);
                objReq = objReq.Get_By_id(requesterid);
                ContactInfo_mst objReqContInfo = new ContactInfo_mst();
                objReqContInfo = objReqContInfo.Get_By_id(objReq.Userid);

                obj.From = Resources.MessageResource.strAdminEmail.ToString();
                obj.To = objC_info.Emailid;
                obj.Subject = "High Priority Call. Ticket Id: " + incidentid;
                obj.Body = "Dear Sir/Madam,<br/>High Priority Call has been logged, please find below the Complaint  details .<br/><br/><b>Complaints Details : </b> <br/><br/><b>Ticket Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + incidentid + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Title + " <br/><b>Site&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objSite.Sitename + "<br/><b>Logged Date & Time&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Createdatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objIncident.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReq.Username + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqContInfo.Emailid + "<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
                obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
                obj.SentMail();

            }

        }
    }
    protected void txtUsername_TextChanged(object sender, EventArgs e)
    {
        #region Find Userid of User who is Requesting to log a call
        objOrganization = objOrganization.Get_Organization();
        ObjUserLogin = ObjUserLogin.Get_UserLogin_By_UserName(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
        if (ObjUserLogin.Userid == 0)
        {
            string myScript;
            myScript = "<script language=javascript>function __doPostBack(eventTarget, eventArgument){var theForm = document.forms['aspnetForm'];  if (theForm){  theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit(); }} var Flag= confirm('User Does not Exist,Do You Want to Create User');if(Flag==true){ __doPostBack('callPostBack', 'create');}if(Flag==false){ __doPostBack('callPostBack', 'notcreate');}</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);

        }
        else {

            ViewState["UserCreate"] = "Exist";
            ContactInfo_mst objCont = new ContactInfo_mst();
            objCont = objCont.Get_By_id(ObjUserLogin.Userid);
            txtEmail.Text = objCont.Emailid;

        }

        #endregion
    }
    protected void txtUsername_TextChanged(object sender, EventArgs e)
    {
        lblerrmsg.Text = "";
        BindDropSite();
        BindDropDept();
        #region Find Userid of User who is Requesting to log a call
        objOrganization = objOrganization.Get_Organization();
        objUser = objUser.Get_UserLogin_By_UserName(txtUsername.Text.Trim().ToString().Trim(), objOrganization.Orgid);
        int usrid = Convert.ToInt16(objUser.Userid);
        int tempuser = 0;
        if (objUser.Userid == 0)
        {
            string myScript;
            tempuser = 1;
            myScript = "<script language=javascript>function __doPostBack(eventTarget, eventArgument){var theForm = document.forms['aspnetForm'];  if (theForm){  theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit(); }} var Flag= confirm('User Does not Exist,Do You Want to Create User');if(Flag==true){ __doPostBack('callPostBack', 'create');}if(Flag==false){ __doPostBack('callPostBack', 'notcreate');}</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            Session["tempuser"] = tempuser;
            //txtassignasset.Text = "";
        }
        else
        {
            IncidentToAsset(usrid);
            ContactInfo_mst objConInfo = new ContactInfo_mst();
            objConInfo = objConInfo.Get_By_id(usrid);
            txtEmail.Text = objConInfo.Emailid;
            //txtassignasset.Text = assetid.ToString();
            //txtassignasset.Text = compname;
            Session["assignassetid"] = assetid;
            Session["UserCreate"] = "Exist";
        }
        string username1 = txtUsername.Text.Trim().ToString();
        Session["Username"] = username1;
        Session["Email"] = txtEmail.Text;

        #endregion
    }
    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";
    }
コード例 #25
0
    protected void UpdateUser()
    {
        int Custid = 0;
        int userid = Convert.ToInt32(Request.QueryString[0]);

        ObjUserLogin   = ObjUserLogin.Get_By_id(userid);
        ObjContactInfo = ObjContactInfo.Get_By_id(userid);

        if (ObjUserLogin.Userid != 0 && ObjContactInfo.Userid != 0)
        {
            txtUserName.Text = ObjUserLogin.Username.ToString().Trim();
            txtPassword.Attributes.Add("value", ObjUserLogin.Password.ToString());
            if (ObjUserLogin.City != null)
            {
                txtCity.Text = ObjUserLogin.City.ToString().Trim();
            }

            if (ObjUserLogin.Company != null)
            {
                txtCompany.Text = ObjUserLogin.Company.ToString().Trim();
            }

            txtRetypePassword.Attributes.Add("value", ObjUserLogin.Password.ToString());
            dropRole.SelectedValue = ObjUserLogin.Roleid.ToString().Trim();

            ViewState["Roleid"] = ObjUserLogin.Roleid;
            if (ObjUserLogin.ADEnable == true)
            {
                lblAdUser.Text = "Yes";
            }
            else
            {
                lblAdUser.Text = "No";
            }
            txtFname.Text = ObjContactInfo.Firstname.ToString().Trim();
            txtLname.Text = ObjContactInfo.Lastname.ToString().Trim();
            if (ObjContactInfo.Landline != null)
            {
                txtLandline.Text = ObjContactInfo.Landline.ToString().Trim();
            }
            if (ObjContactInfo.Emailid != null)
            {
                txtEmailId.Text = ObjContactInfo.Emailid.ToString().Trim();
            }
            if (ObjContactInfo.Empid != null)
            {
                txtEmpId.Text = ObjContactInfo.Empid.ToString().Trim();
            }
            if (ObjContactInfo.Emailid != null)
            {
                txtEmailId.Text = ObjContactInfo.Emailid.ToString();
            }
            if (ObjContactInfo.Mobile != null)
            {
                txtMobile.Text = ObjContactInfo.Mobile.ToString();
            }
            if (ObjContactInfo.Description != null)
            {
                txtDesc.Text = ObjContactInfo.Description.ToString();
            }


            colCustToSite = objCustToSite.Get_All_By_siteid(ObjContactInfo.Siteid);
            foreach (CustomerToSiteMapping obj in colCustToSite)
            {
                Custid = obj.Custid;
            }
            ViewState["CustId"]       = Custid;
            drpCustomer.SelectedValue = Convert.ToString(Custid);


            BindDrpsite();
            DrpSite.SelectedValue = ObjContactInfo.Siteid.ToString();
            //DrpOrg.SelectedValue = ObjUserLogin.Orgid.ToString();
            BindDrpDepartment();
            DrpDepartment.SelectedValue = ObjContactInfo.Deptid.ToString();

            if (ObjUserLogin.Enable == true)
            {
                DropEnable.SelectedValue = "1";
            }
            else
            {
                DropEnable.SelectedValue = "0";
            }
        }
    }
    protected void txtUsername_TextChanged(object sender, EventArgs e)
    { /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            lblerrmsg.Text = "";
            BindDropSite();
            BindDropDept();


            #region Find Userid of User who is Requesting to log a call
            objOrganization = objOrganization.Get_Organization();
            objUser         = objUser.Get_UserLogin_By_UserName_Ex(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
            int usrid    = Convert.ToInt32(objUser.Userid);
            int tempuser = 0;
            if (objUser.Userid == 0)
            {
                string myScript;
                tempuser = 1;
                myScript = "<script language=javascript>function __doPostBack(eventTarget, eventArgument){var theForm = document.forms['aspnetForm'];  if (theForm){  theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit(); }} var Flag= confirm('User Does not Exist,Do You Want to Create User');if(Flag==true){ __doPostBack('callPostBack', 'create');}if(Flag==false){ __doPostBack('callPostBack', 'notcreate');}</script>";
                Page.RegisterClientScriptBlock("MyScript", myScript);
                Session["tempuser"] = tempuser;
                txtassignasset.Text = "";
                BindDropPriority();
            }
            else
            {
                IncidentToAsset(usrid);
                ContactInfo_mst objConInfo = new ContactInfo_mst();
                objConInfo    = objConInfo.Get_By_id(usrid);
                txtEmail.Text = objConInfo.Emailid;
                //txtassignasset.Text = assetid.ToString();
                txtassignasset.Text = compname;

                Session["assignassetid"] = assetid;
                Session["UserCreate"]    = "Exist";
                //changed by shrikant

                colPriority = objPriority.Get_All();
                drpPriority.DataTextField  = "name";
                drpPriority.DataValueField = "priorityid";
                drpPriority.DataSource     = colPriority;
                drpPriority.DataBind();
                ListItem item = new ListItem();
                item.Text = "-------------Select-------------";
                if (objConInfo.userpriority == 1)
                {
                    item.Value = "0";
                    drpPriority.Items.Add(item);
                    drpPriority.SelectedValue = "8";
                }
                else
                {
                    item.Value = "0";
                    drpPriority.Items.Add(item);
                    drpPriority.SelectedValue = "0";
                }

                //end
            }
            string username1 = txtUsername.Text.ToString();
            Session["Username"] = username1;
            Session["Email"]    = txtEmail.Text;
            // change by meenakshi



            #endregion
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void GetUserDetail()
    {
        string userName = "";
        MembershipUser User = Membership.GetUser();
        if (User != null)
        {
            userName = User.UserName.ToString();
            txtUsername.Text = User.UserName.ToString();
        }
        if (userName != "")
        {
            int userid;
            objOrganization = objOrganization.Get_Organization();
            objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid);
            //objRole = objRole.Get_By_id(roleid);
            if (objUser.Userid != 0)
            {
                ContactInfo_mst objConInfo = new ContactInfo_mst();
                userid = objUser.Userid;
                IncidentToAsset(userid);
                objConInfo = objConInfo.Get_By_id(userid);
                txtEmail.Text = objConInfo.Emailid;
                txtassignasset.Text = compname;
                //priorityid = Convert.ToInt32(objConInfo.userpriority);
                //BindDropPriority(int priorityid);

                //ContactInfo_mst objcnt = new ContactInfo_mst();
                //if (objRole.roleid != 1)
                //{

                if (objConInfo.userpriority == 1)
                {
                    priorityid = objPriority.Get_By_PriorityName("High");
                }
                else
                {
                    priorityid = objPriority.Get_By_PriorityName("Medium");
                }
                //}
                Priority_mst objP = new Priority_mst();
                objP = objPriority.Get_By_id(priorityid);
                colPriority.Add(objP);
                drpPriority.DataTextField = "name";
                drpPriority.DataValueField = "priorityid";
                drpPriority.DataSource = colPriority;
                drpPriority.DataBind();

            }
        }
    }
    protected void txtUsername_TextChanged(object sender, EventArgs e)
    {
        /////Add Exception handilng try catch change by vishal 21-05-2012
        try
        {
            lblerrmsg.Text = "";
            BindDropSite();
            BindDropDept();

            #region Find Userid of User who is Requesting to log a call
            objOrganization = objOrganization.Get_Organization();
            string usern = txtUsername.Text.ToString();
            objUser = objUser.Get_UserLogin_By_UserName_Ex(txtUsername.Text.ToString().Trim(), objOrganization.Orgid);
            int usrid = Convert.ToInt32(objUser.Userid);
            int tempuser = 0;
            if (objUser.Userid == 0)
            {
                string myScript;
                tempuser = 1;
                myScript = "<script language=javascript>function __doPostBack(eventTarget, eventArgument){var theForm = document.forms['aspnetForm'];  if (theForm){  theForm.__EVENTTARGET.value = eventTarget;theForm.__EVENTARGUMENT.value = eventArgument;theForm.submit(); }} var Flag= confirm('User Does not Exist,Do You Want to Create User');if(Flag==true){ __doPostBack('callPostBack', 'create');}if(Flag==false){ __doPostBack('callPostBack', 'notcreate');}</script>";
                Page.RegisterClientScriptBlock("MyScript", myScript);
                Session["tempuser"] = tempuser;
                txtassignasset.Text = "";
                BindDropPriority();
            }
            else
            {
                IncidentToAsset(usrid);
                ContactInfo_mst objConInfo = new ContactInfo_mst();
                objConInfo = objConInfo.Get_By_id(usrid);
                txtEmail.Text = objConInfo.Emailid;
                //txtassignasset.Text = assetid.ToString();
                txtassignasset.Text = compname;
                Session["assignassetid"] = assetid;
                Session["UserCreate"] = "Exist";
                //changed by shrikant
                colPriority = objPriority.Get_All();
                drpPriority.DataTextField = "name";
                drpPriority.DataValueField = "priorityid";
                drpPriority.DataSource = colPriority;
                drpPriority.DataBind();
                ListItem item = new ListItem();
                item.Text = "-------------Select-------------";
                if (objConInfo.userpriority == 1)
                {
                    item.Value = "0";
                    drpPriority.Items.Add(item);
                    drpPriority.SelectedValue = "8";
                }
                else
                {
                    item.Value = "0";
                    drpPriority.Items.Add(item);
                    drpPriority.SelectedValue = "0";
                }
                //end
            }
            string username1 = txtUsername.Text.ToString();
            Session["Username"] = username1;
            Session["Us"] = username1;
            Session["USName"] = username1;
            Session["Email"] = txtEmail.Text;
           // ViewState["Name"] = username1;
            // change by meenakshi
            #endregion
        }
        catch (Exception ex)
        {
            string myScript;
            myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
            Page.RegisterClientScriptBlock("MyScript", myScript);
            return;
        }
    }
    protected void BindIncidentToProblem()
    {
        if (Session["IncidentToProblem"] != null)
        {
            int incidentid = Convert.ToInt16(Session["IncidentToProblem"].ToString());

            Incident_mst objIncident = new Incident_mst();
            IncidentStates objIncidentStates = new IncidentStates();
            objIncident = objIncident.Get_By_id(incidentid);
            objIncidentStates = objIncidentStates.Get_By_id(incidentid);
            objuser = objuser.Get_By_id(objIncident.Requesterid);
            if (objIncidentStates.Priorityid != 0)
            {
                drpPriority.SelectedValue = Convert.ToString(objIncidentStates.Priorityid);

            }
            if (objIncidentStates.Categoryid != 0)
            {
                drpCategory.SelectedValue = Convert.ToString(objIncidentStates.Categoryid);
                BindDropSubCategory();

            }

            if (objIncidentStates.Subcategoryid  != 0)
            {

                drpSubcategory.SelectedValue = Convert.ToString(objIncidentStates.Subcategoryid);
            }
            if (objIncidentStates.Technicianid  != 0)
            {
                drpTechnician.SelectedValue = Convert.ToString(objIncidentStates.Technicianid);

            }
            txtDescription.Text = objIncident.Description;
            txtTitle.Text  = objIncident.Title;
            if (objuser.Userid != 0)
            {
                ContactInfo_mst objInfo = new ContactInfo_mst();
                objInfo = objInfo.Get_By_id(objuser.Userid);
                txtUsername.Text = objuser.Username;
                txtEmail.Text = objInfo.Emailid;
                ViewState["UserCreate"] = "Exist";
            }

        }
    }
    public void SentMailToTechnicianForProblemCall(int problemid, int userid)
    {
        string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString();
        string strContactNumber = Resources.MessageResource.strContactNumber.ToString();
        Problem_mst objProblem = new Problem_mst();
        objUser = objUser.Get_By_id(userid);
        ContactInfo_mst objCont_info = new ContactInfo_mst();
        objCont_info = objCont_info.Get_By_id(objUser.Userid);
        objProblem = objProblem.Get_By_id(problemid);
        objPriority = objPriority.Get_By_id(objProblem.Priorityid);
        UserLogin_mst objReq = new UserLogin_mst();
        objReq = objReq.Get_By_id(objProblem.Requesterid);
        ContactInfo_mst objReqCont = new ContactInfo_mst();
        objReqCont = objReqCont.Get_By_id(objReq.Userid);
        objSDE = objSDE.Get_By_id(objProblem.CreatedByid);

        if (objCont_info.Emailid != null)
        {
            obj.To = objCont_info.Emailid;
            obj.From = Resources.MessageResource.strAdminEmail.ToString();
            obj.Subject = " New Problem Call Assigned to you. Problem Id : " + problemid;
            obj.Body = "Dear&nbsp;" + objUser.Username + "," + "<br/>  A Call with the following details have been assigned to you.<br/><br/><b>Problem Details : </b> <br/><br/><b>Problem Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.ProblemId + "<br/><b>Title of Call&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.title + " <br/><b>Logged Date & Time&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;:</b>" + objProblem.CreateDatetime + "<br/><b>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objProblem.Description + "<br/><b>Priority&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b> " + objPriority.Name + "<br/><b>UserName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReq.Username + "<br/><b>Mobile No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objReqCont.Mobile + "<br/><b>Landline No.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:<b/>" + objReqCont.Landline + "<br/><b>Mail Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</b>" + objReqCont.Emailid + "<br/><b>Service Desk Executive&nbsp;&nbsp;&nbsp;:</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at <b>" + strContactNumber + "</b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>";
            obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString();
            obj.SentMail();

        }
    }