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"; }
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 " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</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(); } }
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(); }
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(); }
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"; } } }
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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objReq.Username + "<br/><b>Mail Address :</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(); } } }
public object GenerateIncident_mstObject(ref IDataReader returnData) { Incident_mst obj = new Incident_mst(); while (returnData.Read()) { obj.Incidentid = (int)returnData["Incidentid"]; obj.Title = (String)returnData["Title"]; if (returnData["Extension"] != DBNull.Value) { obj.Extension = Convert.ToInt64(returnData["Extension"]); //uncommented by lalit } //if (returnData["Extension"].ToString().Length > 0) //{ // obj.Extension = (int)returnData["Extension"]; //} //else //{ // obj.Extension = 0; //} if (returnData["AMCCall"] != DBNull.Value) { obj.AMCCall = (bool)returnData["AMCCall"]; } obj.Timespentonreq = (int)returnData["Timespentonreq"]; obj.Slaid = (int)returnData["Slaid"]; obj.Siteid = (int)returnData["Siteid"]; obj.Requesterid = (int)returnData["Requesterid"]; obj.Modeid = (int)returnData["Modeid"]; if (returnData["Description"] != DBNull.Value) { obj.Description = (String)returnData["Description"]; } obj.Deptid = (int)returnData["Deptid"]; obj.Createdbyid = (int)returnData["Createdbyid"]; DateTime Mydatetime = new DateTime(); Mydatetime = (DateTime)returnData["Createdatetime"]; obj.Createdatetime = Mydatetime.ToString(); DateTime Complettime = new DateTime(); if (returnData["Completedtime"] != DBNull.Value) { Complettime = (DateTime)returnData["Completedtime"]; obj.Completedtime = Complettime.ToString(); } if (returnData["ExternalTicketNo"] != DBNull.Value) { obj.ExternalTicketNo = (String)returnData["ExternalTicketNo"]; } if (returnData["VendorId"] != DBNull.Value) { obj.VendorId = (int)returnData["VendorId"]; } if (returnData["Reporteddatetime"] != DBNull.Value) { DateTime reporteddatetime = new DateTime(); reporteddatetime = (DateTime)returnData["Reporteddatetime"]; obj.Reporteddatetime = reporteddatetime.ToString("dd/MM/yyyy hh:mm:ss tt"); } } returnData.Close(); returnData.Dispose(); return obj; }
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) { e.Row.Cells[5].Text = objUser.Username.ToString(); } else { e.Row.Cells[5].Text = ""; } #endregion #region Bind Datarow at run time with Statusid to Status int statusid = Convert.ToInt32(e.Row.Cells[6].Text); objStatus = objStatus.Get_By_id(statusid); if (objStatus.Statusid != 0) { e.Row.Cells[6].Text = objStatus.Statusname.ToString(); } else { e.Row.Cells[6].Text = ""; } #endregion #region Bind Datarow at run time with Priorityid to Priority int priorityid = Convert.ToInt32(e.Row.Cells[7].Text); objPriority = objPriority.Get_By_id(priorityid); if (objPriority.Priorityid != 0) { e.Row.Cells[7].Text = objPriority.Name.ToString(); } else { e.Row.Cells[7].Text = ""; } #endregion #region Bind Datarow at run time with Siteid to Site int siteid = Convert.ToInt32(e.Row.Cells[8].Text); objSite = objSite.Get_By_id(siteid); if (objSite.Siteid != 0) { string custSiteName; int custid = 0; colCustToSite = objCustToSite.Get_All_By_siteid(objSite.Siteid); foreach (CustomerToSiteMapping objCuToSite in colCustToSite) { custid = objCuToSite.Custid; } objCustomer = objCustomer.Get_By_id(custid); e.Row.Cells[8].Text = objCustomer.Customer_name + "/" + objSite.Sitename.ToString(); } else { e.Row.Cells[8].Text = ""; } #endregion #region Apply Color Coding to Open Calls,According to define SLA if (varStatusOpen.ToLower() == objStatus.Statusname.ToString().ToLower()) { Incident_mst obj = new Incident_mst(); obj = obj.Get_By_id(varIncidentid); if (obj.Incidentid != 0) { if (obj.Slaid != 0) { #region Declare local variables,and objects of various classes int percent; ProcessEscalateEmail objPro = new ProcessEscalateEmail(); #endregion #region Get Total Resolution time define for particular SLA and Time Spent on Request TotalResolutionTime = objPro.GetResolutionTimeInMins(obj.Slaid); TotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(varIncidentid, siteid, varCreateDatetime, DateTime.Now.ToString()); if (TotalTimeSpentonCall < 0) { TotalTimeSpentonCall = 0; } #endregion #region Calculate Percent if (TotalResolutionTime != 0) { percent = (TotalTimeSpentonCall * 100) / TotalResolutionTime; } else { percent = 0; } #endregion ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusOpen); foreach (ColorScheme_mst objCol in colColor) { if (objCol.Percnt_to != 0) { if (percent >= objCol.Percnt && percent <= objCol.Percnt_to) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } else { if (percent >= objCol.Percnt) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } } } else { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus("NonSLA"); foreach (ColorScheme_mst objCol in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } } } #endregion #region Apply Color Coding to Close Calls if (varStatusClose.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusClose); foreach (ColorScheme_mst obj in colColor) { try { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } catch (Exception ex) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString("White"); } } } #endregion #region Apply Color Coding to On Hold Calls if (varStatusOnHold.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusOnHold); foreach (ColorScheme_mst obj in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } } #endregion #region Apply Color Coding to Resolved Calls if (varStatusResolved.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusResolved); foreach (ColorScheme_mst obj in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } } #endregion } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void SendEmail(int incidentid, int level, int slaid) { SentEmail objEmail = new SentEmail(); #region Sent Mail for Level 1 Escalation if (level == 1) { objLevel1 = objLevel1.Get_By_Slaid(slaid); if (objLevel1 != null) { string varemail = objLevel1.Emailid; string[] arrEmail = varemail.Split(','); int lengthCount = Convert.ToInt32(arrEmail.Length.ToString()); for (int i = 0; i < lengthCount - 1; i++) { string emailId = arrEmail[i].ToString(); if (emailId != "," && emailId != "") { objIncident = objIncident.Get_By_id(incidentid); if (objIncident != null) { objCheckLevel1 = objCheckLevel1.Get_By_id(incidentid); if (objCheckLevel1.Incidentid == 0) { CheckLevel1Escalate obj = new CheckLevel1Escalate(); obj.Incidentid = incidentid; obj.Level1escalate = true; obj.Insert(); objEmail.To = emailId; objEmail.From = Resources.MessageResource.strEmailFromLevel1Escalate.ToString(); objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title; objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards Admin"; objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString(); objEmail.SentMail(); } } } } } } #endregion #region Sent Mail for Level 2 Escalation if (level == 2) { objLevel2 = objLevel2.Get_By_Slaid(slaid); if (objLevel2.Slaid != 0) { string varemail = objLevel2.Emailid; string[] arrEmail = varemail.Split(','); int lengthCount = Convert.ToInt32(arrEmail.Length.ToString()); for (int i = 0; i < lengthCount - 1; i++) { string emailId = arrEmail[i].ToString(); if (emailId != "," && emailId != "") { objIncident = objIncident.Get_By_id(incidentid); if (objIncident != null) { objCheckLevel2 = objCheckLevel2.Get_By_id(incidentid); if (objCheckLevel2.Incidentid == 0) { CheckLevel2Escalate obj = new CheckLevel2Escalate(); obj.Incidentid = incidentid; obj.Level2escalate = true; obj.Insert(); objEmail.To = emailId; objEmail.From = Resources.MessageResource.strEmailFromLevel2Escalate.ToString(); objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title; objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards <br/> Admin"; objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString(); objEmail.SentMail(); } } } } } } #endregion #region Sent Mail for Level 3 Escalation if (level == 3) { objLevel3 = objLevel3.Get_By_Slaid(slaid); if (objLevel3.Slaid != 0) { string varemail = objLevel3.Emailid; string[] arrEmail = varemail.Split(','); int lengthCount = Convert.ToInt32(arrEmail.Length.ToString()); for (int i = 0; i < lengthCount - 1; i++) { string emailId = arrEmail[i].ToString(); if (emailId != "," && emailId != "") { objIncident = objIncident.Get_By_id(incidentid); if (objIncident != null) { objCheckLevel3 = objCheckLevel3.Get_By_id(incidentid); if (objCheckLevel3.Incidentid == 0) { CheckLevel3Escalate obj = new CheckLevel3Escalate(); obj.Incidentid = incidentid; obj.Level3escalate = true; obj.Insert(); objEmail.To = emailId; objEmail.From = Resources.MessageResource.strEmailFromLevel3Escalate.ToString(); objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title; objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards Admin"; objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString(); objEmail.SentMail(); } } } } } } #endregion }
string GetAMCCall(int IncidentID) { string boolAmccall = "NO"; objIncident = objIncident.Get_By_id(IncidentID); if (objIncident.AMCCall == true) { boolAmccall = "YES"; } return boolAmccall; }
protected void BindIncidentToChangegrid() { #region Declaration of table Variable DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); #endregion int changeid = Convert.ToInt32(Request.QueryString[0]); colincidenttochange = ObjIncidenttoChanges.Get_All_By_Changeid(changeid); foreach (Incident_To_Change obj in colincidenttochange) { int id = Convert.ToInt32(obj.Incidentid); objIncident = objIncident.Get_By_id(id); DataRow row; row = dtTable.NewRow(); // row["incidentid"] = Convert.ToString(objIncident.Incidentid); row["ID"] = objIncident.Incidentid; row["title"] = objIncident.Title; row["requesterid"] = Convert.ToString(objIncident.Requesterid); row["technicianid"] = objIncidentStates.Technicianid; objIncidentStates = objIncidentStates.Get_By_id(objIncident.Incidentid); row["statusid"] = objIncidentStates.Statusid; row["createdatetime"] = Convert.ToString(objIncident.Createdatetime); //row["createdbyid"] = Convert.ToString(objIncident.Createdbyid); //row["siteid"] = Convert.ToString(objIncident.Siteid); //row["priorityid"] = objIncidentStates.Priorityid; dtTable.Rows.Add(row); } grdvwincidentchange.DataSource = dtTable; grdvwincidentchange.DataBind(); }
public CollectionBase GenerateIncident_mstCollection(ref IDataReader returnData) { BLLCollection<Incident_mst> col = new BLLCollection<Incident_mst>(); while (returnData.Read()) { Incident_mst obj = new Incident_mst(); obj.Incidentid = (int)returnData["Incidentid"]; obj.Title = (String)returnData["Title"]; obj.Timespentonreq = (int)returnData["Timespentonreq"]; obj.Slaid = (int)returnData["Slaid"]; obj.Siteid = (int)returnData["Siteid"]; obj.Requesterid = (int)returnData["Requesterid"]; if (returnData["Modeid"] != DBNull.Value) { obj.Modeid = (int)returnData["Modeid"]; } if (returnData["Description"] != DBNull.Value) { obj.Description = (String)returnData["Description"]; } if (returnData["Deptid"] != DBNull.Value) { obj.Deptid = (int)returnData["Deptid"]; } obj.Createdbyid = (int)returnData["Createdbyid"]; DateTime Mydatetime = new DateTime(); Mydatetime = (DateTime)returnData["Createdatetime"]; obj.Createdatetime = Mydatetime.ToString(); DateTime Complettime = new DateTime(); if (returnData["Completedtime"] != DBNull.Value) { Complettime = (DateTime)returnData["Completedtime"]; obj.Completedtime = Complettime.ToString(); } if (returnData["ExternalTicketNo"] != DBNull.Value) { obj.ExternalTicketNo = (String)returnData["ExternalTicketNo"]; } if (returnData["VendorId"] != DBNull.Value) { obj.VendorId = (int)returnData["VendorId"]; } col.Add(obj); } returnData.Close(); returnData.Dispose(); return col; }
protected void UpdatePanel1() { pan1.Visible = true; pan2.Visible = false; lnkEdit.Visible = true; btnCancel.Visible = false; btnUpdate.Visible = false; int incidentid = Convert.ToInt32(Request.QueryString[0]); if (incidentid != 0) { Session["incidentid"] = incidentid; lblIncidentId.Text = incidentid.ToString(); objIncident = objIncident.Get_By_id(incidentid); if (objIncident.Incidentid != 0) { ViewState["CreatedbyId"] = Convert.ToString(objIncident.Createdbyid); objIncidentStates = objIncidentStates.Get_By_id(incidentid); if (objIncidentStates.Incidentid != 0) { string status = Resources.MessageResource.strStatusOnHold.ToString(); lblCalltype.Text = GetRequestTypeName(objIncidentStates.Requesttypeid); //lblImpact.Text = GetImpactString(objIncidentStates.Impactid); lblStatus.Text = GetStatusString(objIncidentStates.Statusid); lblMode.Text = GetModeString(objIncident.Modeid); lblPriority.Text = GetPriorityString(objIncidentStates.Priorityid); lblSLA.Text = GetSLAName(objIncident.Slaid); lblSite.Text = GetSiteName(objIncident.Siteid); lblDept.Text = GetDepartmentName(objIncident.Deptid); lblCategory.Text = GetCategoryName(objIncidentStates.Categoryid); lblAMCcall.Text = GetAMCCall(objIncident.Incidentid); lblSubCategory.Text = GetSubCategoryName(objIncidentStates.Subcategoryid); lblTechnician.Text = GetUsername(objIncidentStates.Technicianid); lblCreatedby.Text = GetUsername(objIncident.Createdbyid); lblReportedDate.Text = objIncident.Reporteddatetime; lblRequesterDisp.Text = GetUsername(objIncident.Requesterid); lblDateDisp.Text = objIncident.Createdatetime.ToString().Trim(); lblCreatedDate.Text = objIncident.Createdatetime.ToString().Trim(); // lblAMCcall.Text = objIncident.AMCCall.ToString().Trim(); ////////////////////////////////////////////////////change done by meenakshi if (objIncident.ExternalTicketNo != null) { //lblExternalTicket.Text = objIncident.ExternalTicketNo.ToString().Trim(); lblExternalTicket.Text = (string)Session["compname"]; } ///////////////////////////////////////////////////end //if (objIncident.AMCCall != null) //{ // lblAMCcall.Text = objIncident.AMCCall.ToString().Trim(); //} lblVendor.Text = GetVendorName(Convert.ToInt32(objIncident.VendorId.ToString())); if (objIncident.Completedtime != null) { lblCompletedDate.Text = objIncident.Completedtime.ToString().Trim(); lbltimespentonDisp.Visible = true; int varTimeSpentonCall = 0; varTimeSpentonCall = Convert.ToInt32(objIncident.Timespentonreq.ToString()); if (varTimeSpentonCall < 60) { lbltimespentonreq.Text = varTimeSpentonCall.ToString() + " min"; } else { int hr; int min; hr = varTimeSpentonCall / 60; min = varTimeSpentonCall % 60; lbltimespentonreq.Text = hr + " hr" + ":" + min + " min"; } } else { lblCompletedDate.Text = "-"; } lblTitle.Text = objIncident.Title; //if (objIncident.Title.IndexOf("-") != -1) //{ // string[] extension = objIncident.Title.Split(("-").ToCharArray()); // lblextension.Text = extension[1]; // lblTitle.Text = extension[0]; //} //else //{ // lblTitle.Text = objIncident.Title; // lblextension.Text = "No Extension"; //} if (objIncident.Extension != null) { lblextension.Text = (objIncident.Extension).ToString(); } lblDescription.Text = objIncident.Description; } // //lblTitle.Text = objIncident.Title; // if (objIncident.Title.Length > 0) // { // lblTitle.Text = objIncident.Title; // } // //if (objIncident.Title.IndexOf("-") != -1) // if (objIncident.Extension > 0) // { // //string[] extension = objIncident.Title.Split(("-").ToCharArray()); // lblextension.Text = objIncident.Extension.ToString(); // } // else // { // //lblTitle.Text = objIncident.Title; // lblextension.Text = "No Extension"; // } // lblDescription.Text = objIncident.Description; //} } } }
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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>EstimatedResolutionTime :</b> " + GetResolutionTimeInHours(objIncident.Slaid) + "<br/><b>Email Address :</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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</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 <b>" + objtech.Username + "</b> on <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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution+ "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</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 <b>" + objtech.Username + "</b> on <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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</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 <b>" + objtech.Username + "</b> on <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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "</br><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</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(); //} } }
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); 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.Subject = "Call Logged. Ticket Id : " + incidentid; LogMessage("Call Open TicketId" + incidentid); ///////////////////////////////////////////////////commented by meenakshi 2nd july 2013 // 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 :</b> " // + incidentid + "<br/><b>Site :</b> " // + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " // + objIncident.Createdatetime + "<br/><b>Description :</b> " // + objIncident.Description + "<br/><b>Priority :</b> " // + objPriority.Name + "<br/><b>Username :</b> " // + objUser.Username + "<br/><b>ResolutionTime :</b> " // + GetResolutionTimeInHours(objIncident.Slaid) // + "<br/><b>Email Address :</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>"; ////////////////////////////////////////////////////end string strBody = "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 :</b> " + incidentid ; strBody = strBody + "<br/><b>Site :</b> " + objSite.Sitename ; strBody = strBody + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime; strBody = strBody + "<br/><b>Description</b> :" + objIncident.Description; strBody = strBody + "<br/><b>Priority :</b> " + objPriority.Name; strBody = strBody + "<br/><b>Username :</b>" + objUser.Username; strBody = strBody + "<br/><b>Email Address :</b> " + objC_info.Emailid; strBody = strBody + "<br/><b>ResolutionTime :</b> " + GetResolutionTimeInHours(objIncident.Slaid); if (objIncident.Siteid ==1) { //location = "1"; //contactnum = "9811801977"; //mailid = "*****@*****.**"; //techid = "16"; //cmd.CommandText = "insert into Incident_mst(Title, Timespentonreq, Slaid, Siteid, Requesterid, Modeid, Description, Deptid, Createdbyid, Createdatetime,Extension,Completedtime, ExternalTicketNo, VendorId,active,AMCCall ,Reporteddatetime)values(@Title, 0, 3, '" + location + "', 2, 5, @Description, 0, 2, @Createdatetime,0,null, null, 0,1, 0 ,@Reporteddatetime)"; //// SentMail("*****@*****.**", "*****@*****.**", subject, body); //strBody = strBody + "<br/><br/>For any other support kindly get in touch with us at 9811801977.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; strBody = strBody + "<br/><br/> <b>For any other support, kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>1st Level : [email protected], Ext: 2259 or +919999969434</b><br/><b>2nd Level : [email protected], Ext: 2178 or +919871164411</b><br/><b>3rd Level : [email protected], Ext: 2175 or +919810079140</b><br/>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; } else if (objIncident.Siteid ==2) { strBody = strBody + "<br/><br/><b>For any other support, kindly get in touch with us at +912266326582 and 6587 or +91 9820831745 (24/7)<br/><br/> In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Name & Contact Details</b><br/><br/><b>Maruti Aldar : 6587</b><br/><b>Ranjana Kamle : 6587</b><br/><b>Brijesh Singh: 6587</b><br/>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident NarimanPoint IT Support Desk, Ext. 6587 </b>"; } else if (objIncident.Siteid == 3) { strBody = strBody + "<br/><br/><b>For any other support kindly get in touch with us at +919930455789 and Extn:7411 / 7412, +917875551291 or at +912266727411/12<br/><br/> In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Tier 1: Darshan Trivedi – (+91 9819404011)</b><br/><b>Tier 2: Sudhir Nate (+91 9930455714), Jignesh Patel (+91 9987228227)</b><br/><b>Tier 3: Apurv Sharma (+91 9930455781)</b>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident BandraKurla IT Support, Ext. 7411 / 7412 </b>"; } else if (objIncident.Siteid == 4) { strBody = strBody + "<br/><br/><b>For any other support kindly get in touch with us at +918041358518, Extn:8516 / 8517 or email at [email protected]<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Chethan Kumar. J</b><br/><b>[email protected]</b><br/><b>System Administrator</b>"; strBody = strBody + "<br/><b>91-9916033777</b><br/><br/><b>Yunus Khatib</b><br/><b>[email protected]</b><br/><b>Systems Manager</b><br/><b>91-9886058585</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> The Oberoi Bangalore IT Support, Ext. 8546 / 8517 </b>"; } else if (objIncident.Siteid == 5) { strBody = strBody + "<br/><br/> <b>For any other support kindly get in touch with us at +91 33 2249 2323 2323 or at +919831519900/ [email protected]<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Arindam Banerjee </b><br/><b>Systems Manager</b><br/><b>The Oberoi Grand</b>"; strBody = strBody + "<br/><b>Email: [email protected]</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> The Oberoi Grand Kolkata IT Support </b>"; } else if (objIncident.Siteid == 6) { //strBody = strBody + "<br/><br/> <b>For any other support kindly get in touch with the </b><br/><br/><b>IT Support team on Extension 6252,Direct Number +91 40 6603 6252,Mobile Number + 91 88860 48662</b><br/><br/><b>Telephone Support staff on Extension 6253, Direct Number +91 40 6603 6253, Mobile Number +91 88860 48663</b><br/><br/><b>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b>"; //strBody = strBody + "<br/><b>IT Supervisor on extension 6251 (or) +91 40 6603 6251</b><br/><b>IT Manager on extension 6250 (or) +91 40 6603 6250 </b>"; // //<br/><br/><b>Name of Contact</b><br/><br/><b>Manoj Kumar</b><br/><b>Shashikanth. J</b><br/><b>Vivekanand Kaatpally</b><br/><br/><b>All the above engineers are available in the above extension number only except</b>"; ////strBody = strBody + "<br/><br/><b>Dasani Malla Reddy</b><br/><br/><b>Extension 6253 </b><br/><b>Direct Number +91 40 6603 6253 </b><br/><br/><b>Mobile Number + 91 88860 48663</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident Hyderabad IT Support </b>"; //strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident Hyderabad IT Support </b>"; strBody = strBody + "<br/><br/> For any other support kindly get in touch with the <br/><br/>IT Support team      on Extension 6252,Direct Number +91 40 6603 6252,Mobile Number + 91 88860 48662<br/><br/>Telephone Support staff      on Extension 6253, Direct Number +91 40 6603 6253, Mobile Number +91 88860 48663<br/><br/>If your queries are unresolved, please call us at the following extension / mobile numbers:"; strBody = strBody + "<br/><br/>IT Supervisor       on extension 6251 (or) +91 40 6603 6251<br/>IT Manager      on extension 6250 (or) +91 40 6603 6250 "; strBody = strBody + "<br/><br/>Yours sincerely,<br/><br/> Trident Hyderabad IT Support "; } else if (objIncident.Siteid == 7) { //strBody = strBody + "<br/><br/>For any other support kindly get in touch with us at 9811801977.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; strBody = strBody + "<br/><br/> <b>For any other support, kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>1st Level : [email protected], Ext: 2259 or +919999969434</b><br/><b>2nd Level : [email protected], Ext: 2178 or +919871164411</b><br/><b>3rd Level : [email protected], Ext: 2175 or +919810079140</b><br/>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; } else if (objIncident.Siteid == 8) { strBody = strBody + "<br/><br/><b>For any other support kindly get in touch with us at Extn:8271 or at +919962218422/ [email protected]<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Satheesh Kumar.S,</b><br/><b>Extn: 8270</b><br/><b>Mobile: +919884398638</b><br/><b>Email: [email protected]</b>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident Chennai IT Support, Ext. 8271 </b>"; } else if (objIncident.Siteid == 9) { strBody = strBody + "<br/><br/><b>For any other support kindly get in touch with us at +911123890505, Extn:2370 or at +911123906180/81<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Pawan Suman & Contact Details +91 7838651733 with email address [email protected]</b>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> Maidens Hotel IT Support, Ext, 2370 </b>"; } else { strBody = strBody + "<br/><br/> <b>For any other support, kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>1st Level : [email protected], Ext: 2259 or +919999969434</b><br/><b>2nd Level : [email protected], Ext: 2178 or +919871164411</b><br/><b>3rd Level : [email protected], Ext: 2175 or +919810079140</b><br/>"; strBody = strBody + "<br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; //strBody = strBody + "<br/><br/>For any other support kindly get in touch with us at 9811801977.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; } LogMessage("Before mail send(Call Open)"); obj.Body = strBody; 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</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.ToInt32(objIncident.Incidentid); string varServerName1; string varfeedbackmode="0"; varServerName1 = Resources.MessageResource.serverNameForChangePage.ToString(); //added by lalit to check feedback mode. feedback should add in mail or not. 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; /////////////////////////////////////////added on 04July13 02:18PM #region Define Regards and ContactNo for differenct Sites string Regards = ""; string Contactno = ""; if (objIncident.Siteid == 1) { Regards = "EIH Central Helpdesk"; Contactno = "+911123890505, Extn:2180 / 2181"; } if (objIncident.Siteid == 2) { Regards = "Trident NarimanPoint IT Support Desk, Ext. 6587"; Contactno = "+912266326582 and 6587 or +91 9820831745 (24/7)"; } if (objIncident.Siteid == 3) { Regards = "Trident BandraKurla IT Support, Ext. 7411 / 7412"; Contactno = "+919930455789 and Extn:7411 / 7412, +917875551291 or at +912266727411/12"; } if (objIncident.Siteid == 4) { Regards = "The Oberoi Bangalore IT Support, Ext. 8546 / 8517 "; Contactno = "+918041358518, Extn:8516 / 8517"; } if (objIncident.Siteid == 5) { Regards = "The Oberoi Grand Kolkata IT Support"; Contactno = "+91 33 2249 2323 2323 or at +919831519900"; } if (objIncident.Siteid == 6) { Regards = "Trident Hyderabad IT Support"; Contactno = "+91 40 6603 6252 and 6252 or + 91 88860 48662"; } if (objIncident.Siteid == 7) { Regards = "EIH Central Helpdesk"; Contactno = "9811801977"; } if (objIncident.Siteid == 8) { Regards = "Trident Chennai IT Support, Ext. 8271"; Contactno = "Extn:8271 or at +919962218422"; } if (objIncident.Siteid == 9) { Regards = "Maidens Hotel IT Support, Ext, 2370"; Contactno = "+911123890505, Extn:2370 or at +911123906180/81"; } #endregion ///////////////////////////////////////////end obj.Subject = "Call Closed Ticket id : " + incidentid; LogMessage("Call Closed TicketId" + 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 <b>" + objtech.Username + "</b> on <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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</b> " + objC_info.Emailid; if (objIncident.Siteid == 1) { obj.Body = obj.Body + @"<br/><br/> <b>For any other support, kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>1st Level : [email protected], Ext: 2259 or +919999969434</b><br/><b>2nd Level : [email protected], Ext: 2178 or +919871164411</b><br/><b>3rd Level : [email protected], Ext: 2175 or +919810079140</b><br/> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; } else if (objIncident.Siteid == 2) { obj.Body = obj.Body + @"<br/><br/> <b>For any other support, kindly get in touch with us at +912266326582 and 6587 or +91 9820831745 (24/7)<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Name & Contact Details</b><br/><br/><b>Maruti Aldar : 6587</b><br/><b>Ranjana Kamle : 6587</b><br/><b>Brijesh Singh: 6587</b><br/> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident NarimanPoint IT Support Desk, Ext. 6587 </b>"; } else if (objIncident.Siteid == 3) { obj.Body = obj.Body + @"<br/><br/><b>For any other support kindly get in touch with us at +919930455789 and Extn:7411 / 7412, +917875551291 or at +912266727411/12<br/><br/> <b>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/>Tier 1: Darshan Trivedi – (+91 9819404011)</b><br/><b>Tier 2: Sudhir Nate (+91 9930455714), Jignesh Patel (+91 9987228227)</b><br/><b>Tier 3: Apurv Sharma (+91 9930455781)</b> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident BandraKurla IT Support, Ext. 7411 / 7412 </b>"; } else if (objIncident.Siteid == 4) { obj.Body = obj.Body + @"<br/><br/> <b>For any other support kindly get in touch with us at +918041358518, Extn:8516 / 8517 or email at [email protected]<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Chethan Kumar. J</b><br/><b>[email protected]</b><br/><b>System Administrator</b> <br/><b>91-9916033777</b><br/><br/><b>Yunus Khatib</b><br/><b>[email protected]</b><br/><b>Systems Manager</b><br/><b>91-9886058585</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> The Oberoi Bangalore IT Support, Ext. 8546 / 8517 </b>"; } else if (objIncident.Siteid == 5) { obj.Body = obj.Body + @"<br/><br/><b>For any other support kindly get in touch with us at +91 33 2249 2323 2323 or at +919831519900/ [email protected]<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Arindam Banerjee </b><br/><b>Systems Manager</b><br/><b>The Oberoi Grand</b> <br/><b>Email: [email protected]</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> The Oberoi Grand Kolkata IT Support </b>"; } else if (objIncident.Siteid == 6) { // obj.Body = obj.Body + @"<br/><br/> <b>For any other support kindly get in touch with the IT Support team on <br/><br/>Extension 6252 </b><br/><br/><b>Direct Number +91 40 6603 6252 </b><br/><b>Mobile Number + 91 88860 48662</b><br/><br/><b>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b> // <br/><b>IT Supervisor on extension 6251 (or) +91 40 6603 6251</b><br/><b>IT Manager on extension 6250 (or) +91 40 6603 6250 </b><br/><br/><b>Name of Contact</b> <br/><br/><b>Manoj Kumar</b><br/><b>Shashikanth. J</b><br/><b>Vivekanand Kaatpally</b><br/><br/><b>All the above engineers are available in the above extension number only except</b> // <br/><br/><b>Dasani Malla Reddy</b><br/><br/><b>Extension 6253 </b><br/><b>Direct Number +91 40 6603 6253 </b><br/><br/><b>Mobile Number + 91 88860 48663</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident Hyderabad IT Support </b>"; obj.Body = obj.Body + @"<br/><br/> For any other support kindly get in touch with the <br/><br/>IT Support team      on Extension 6252,Direct Number +91 40 6603 6252,Mobile Number + 91 88860 48662<br/><br/>Telephone Support staff      on Extension 6253, Direct Number +91 40 6603 6253, Mobile Number +91 88860 48663<br/><br/>If your queries are unresolved, please call us at the following extension / mobile numbers: <br/><br/>IT Supervisor       on extension 6251 (or) +91 40 6603 6251<br/>IT Manager      on extension 6250 (or) +91 40 6603 6250 <br/><br/>Yours sincerely,<br/><br/> Trident Hyderabad IT Support "; } else if (objIncident.Siteid == 7) { obj.Body = obj.Body + @"<br/><br/> <b>For any other support, kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>1st Level : [email protected], Ext: 2259 or +919999969434</b><br/><b>2nd Level : [email protected], Ext: 2178 or +919871164411</b><br/><b>3rd Level : [email protected], Ext: 2175 or +919810079140</b><br/> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; } else if (objIncident.Siteid == 8) { obj.Body = obj.Body + @"<br/><br/><b>For any other support kindly get in touch with us at Extn:8271 or at +919962218422/ [email protected]<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Satheesh Kumar.S,</b><br/><b>Extn: 8270</b><br/><b>Mobile: +919884398638</b><br/><b>Email: [email protected]</b> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> Trident Chennai IT Support, Ext. 8271 </b>"; } else if (objIncident.Siteid == 9) { obj.Body = obj.Body + @"<br/><br/><b>For any other support kindly get in touch with us at +911123890505, Extn:2370 or at +911123906180/81<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>Pawan Suman & Contact Details +91 7838651733 with email address [email protected]</b> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> Maidens Hotel IT Support, Ext, 2370 </b>"; } else { obj.Body = obj.Body + @"<br/><br/> <b>For any other support, kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<br/><br/>In case your queries unresolved or not satisfactory kindly reach to below escalation matrix:</b><br/><br/><b>1st Level : [email protected], Ext: 2259 or +919999969434</b><br/><b>2nd Level : [email protected], Ext: 2178 or +919871164411</b><br/><b>3rd Level : [email protected], Ext: 2175 or +919810079140</b><br/> <br/><br/><b>Yours sincerely,</b><br/><br/> <b> EIH Central Helpdesk </b>"; } //+ "<br/><br/> For any other support, kindly get in touch with us at " //+ Contactno + ".<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/><br/> <b>" //+ Regards + "</b>"; } else { obj.Body = "Dear " + objC_info.Firstname + ",<br/><br/> <b>Incident Status:</b> Issue Resolved and call closed by <b>" + objtech.Username + "</b> on <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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</b> " + objC_info.Emailid + "<br/><br/> For any other support, kindly get in touch with us at " + Contactno + ".<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>" + Regards + "</b>"; } LogMessage("Before mail send(Call Closed)"); obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); } } } //int id = Convert.ToInt32(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 <b>" + objtech.Username + "</b> on <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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "</br><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</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(); //} } }
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(); if (objIncident.Siteid == 1) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at +911123890505, Extn:2180 / 2181 or at +911123906180/81.<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>EIH Central Helpdesk <b></b>"; } if (objIncident.Siteid == 2) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at +912266326582 and 6587 or +91 9820831745 (24/7).<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>Trident NarimanPoint IT Support Desk, Ext. 6587<b></b>"; } if (objIncident.Siteid == 3) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at +919930455789, +917875551291 or at +912266727411/12.<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>Trident BandraKurla IT Support, Ext. 7411 / 7412<b></b>"; } if (objIncident.Siteid == 4) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at +918041358518, Extn:8516 / 8517.<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>The Oberoi Bangalore IT Support, Ext. 8546 / 8517 <b></b>"; } if (objIncident.Siteid == 5) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at +912266326582 and 6587 or +91 9820831745 (24/7).<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>The Oberoi Grand Kolkata IT Support<b></b>"; } if (objIncident.Siteid == 6) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at Ext: 6252 or at +91 40 6603 6252 and + 91 88860 48662<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>Trident Hyderabad IT Support<b></b>"; } if (objIncident.Siteid == 7) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at 9811801977.<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>EIH Central Helpdesk<b></b>"; } if (objIncident.Siteid == 8) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at Extn:8271 or at +919962218422.<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>Trident Chennai IT Support, Ext. 8271<b></b>"; } if (objIncident.Siteid == 9) { obj.Body = @"Dear " + 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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mobile No. :<b/>" + objUserInfo.Mobile + "<br/><b>Landline No. :<b/>" + objUserInfo.Landline + "<br/><b>Mail Address :</b>" + objC_info.Emailid + "<br/><b>Service Desk Executive :</b>" + objSDE.Username + "<br/><br/> For any other support kindly get in touch with us at +911123890505, Extn:2370 or at +911123906180/81.<b></b>.<br/><br/> <b>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/>Maidens Hotel IT Support<b></b>"; } obj.Subject = " New Call Assigned to you. Ticket id : " + incidentid; obj.SmtpServer = obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); } }
protected void UpdatePanel2() { string compname; lbltimespentonDisp.Visible = false; lbltimespentonreq.Text = ""; BindDropSite(); BindDropCategory(); //BindDropImpact(); BindDropStatus(); BindDropMode(); BindDropPriority(); BindDropRequestType(); BindDropVendor(); int incidentid = Convert.ToInt32(Request.QueryString[0]); if (incidentid != 0) { objIncident = objIncident.Get_By_id(incidentid); if (objIncident.Incidentid != 0) { #region Get Current User and his Role MembershipUser User = Membership.GetUser(); string varUserRole = ""; string varRoleTechnician = ""; string userName = ""; if (User != null) { userName = User.UserName.ToString(); string[] arrUserRole = Roles.GetRolesForUser(); varUserRole = arrUserRole[0].ToString(); varRoleTechnician =Resources.MessageResource.strTechnicianRole.ToString(); if (varUserRole == varRoleTechnician) { drpRequestType.Visible = false; drpMode.Visible = false; drpPriority.Visible = false; drpSite.Visible = false; drpDepartment.Visible = false; drpTechnician.Visible = false; } } #endregion objIncidentStates = objIncidentStates.Get_By_id(incidentid); drpRequestType.SelectedValue = Convert.ToString(objIncidentStates.Requesttypeid); drpStatus.SelectedValue = Convert.ToString(objIncidentStates.Statusid); drpMode.SelectedValue = Convert.ToString(objIncident.Modeid); drpPriority.SelectedValue = Convert.ToString(objIncidentStates.Priorityid); lblslaPanel2.Text = GetSLAName(objIncident.Slaid); drpSite.SelectedValue = Convert.ToString(objIncident.Siteid); drpVendor.SelectedValue = Convert.ToString(objIncident.VendorId); BindDropDept(); BindDropTechnician(); if (objIncident.ExternalTicketNo != null) { //change done by meenakshi //txtExternalTicket.Text = objIncident.ExternalTicketNo.ToString().Trim(); txtExternalTicket.Text = (string)(Session["compname"]); //compname = (string)(Session["compname"]); //txtExternalTicket.Text=compname.ToString(); } drpDepartment.SelectedValue = Convert.ToString(objIncident.Deptid); //if (drpTechnician.SelectedValue != "0") //{ drpTechnician.SelectedValue = Convert.ToString(objIncidentStates.Technicianid); // } drpCategory.SelectedValue = Convert.ToString(objIncidentStates.Categoryid); BindDropSubCategory(); drpSubcategory.SelectedValue = Convert.ToString(objIncidentStates.Subcategoryid); lblCreatedbyPanel2.Text = GetUsername(objIncident.Createdbyid); lblCreateddatePanel2.Text = objIncident.Createdatetime.ToString().Trim(); lblReportedDate.Text = objIncident.Createdatetime.ToString().Trim(); if (objIncident.Completedtime != null) { lblCompletedDatePanel2.Text = objIncident.Completedtime.ToString().Trim(); } else { lblCompletedDatePanel2.Text = ""; } lblTitle.Text = objIncident.Title; lblDescription.Text = objIncident.Description; } } }
public int Insert_Incident_mst(Incident_mst objIncident) { return (int)ExecuteNonQuery(Sp_Incident_Insert, new object[] { objIncident.Title, objIncident.Timespentonreq, objIncident.Slaid, objIncident.Siteid, objIncident.Requesterid, objIncident.Modeid, objIncident.Description, objIncident.Deptid, objIncident.Createdbyid, objIncident.Createdatetime, objIncident.Extension, objIncident.Completedtime, objIncident.ExternalTicketNo, objIncident.VendorId, objIncident.AMCCall ,objIncident.Reporteddatetime}); }
protected void FunctionUpdate() { #region Get incidentid from QueryString int incidentid = Convert.ToInt32(Request.QueryString[0]); #endregion #region Declare Local Variable // Declare local Variable int historyid; int varTotalTimeSpentonCall = 0; int SLAid; string userName; int userid = 0; string strCreateDatetime = ""; string statusString; string strStatusOpen; string strStatusClose; string strStatusResolved; string strStatusOnHold; bool FlagTechnicianId; bool FlagCloseStatus; int requesttypeid; string OldStatusString; FlagTechnicianId = false; FlagCloseStatus = false; string oldCompletedTime = ""; Incident_mst objIncidentOld = new Incident_mst(); IncidentStates objIncidentStatesOld = new IncidentStates(); bool FlagClosedStatus = true; string VarResolutionAdded = ""; #endregion #region Fetch Current User // Fetch Current User and assign to local variable userName MembershipUser User = Membership.GetUser(); userName = User.UserName.ToString(); #endregion #region Fetch Data from MessageResource file and assign to Local Variable statusString = GetStatusString(Convert.ToInt32(drpStatus.SelectedValue)); strStatusOpen = Resources.MessageResource.strStatusOpen.ToString().Trim(); strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim(); strStatusResolved = Resources.MessageResource.strStatusResolved.ToString().Trim(); strStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString().Trim(); #endregion # region Get SLAid by Calling Function Get_By_SLAid() ,via Passing Parameter siteid and priorityid SLAid = objIncident.Get_By_SLAid(Convert.ToInt32(drpSite.SelectedValue), Convert.ToInt32(drpPriority.SelectedValue)); requesttypeid = Convert.ToInt32(Resources.MessageResource.strRequestTypeId.ToString()); if (requesttypeid == Convert.ToInt32(drpRequestType.SelectedValue)) { SLAid = 0; } #endregion #region On the basis of Username ,get Userid by calling Function Get_UserLogin_By_UserName(),via passing parameter Username and organizationid if (userName != "") { objOrganization = objOrganization.Get_Organization(); objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid); if (objUser.Userid != 0) { userid = objUser.Userid; } } #endregion //#region Insert value in IncidentHistory Table ,for every update of Page //if (statusString.ToLower() == strStatusClose.ToLower()) //{ // if (Session["ResolutionAdded"] != null) // { // VarResolutionAdded = Session["ResolutionAdded"].ToString(); // } // if (VarResolutionAdded == "true") // { // objIncidentHistory.Incidentid = incidentid; // objIncidentHistory.Operationownerid = userid; // objIncidentHistory.Operation = "closed"; // objIncidentHistory.Insert(); // Session["ResolutionAdded"] = "false"; // } // else { FlagClosedStatus = false; } //} //else if (statusString.ToLower() == strStatusResolved.ToLower()) //{ // objIncidentHistory.Incidentid = incidentid; // objIncidentHistory.Operationownerid = userid; // objIncidentHistory.Operation = "resolved"; // objIncidentHistory.Insert(); //} //else //{ // objIncidentHistory.Incidentid = incidentid; // objIncidentHistory.Operationownerid = userid; // objIncidentHistory.Operation = "update"; // objIncidentHistory.Insert(); //} //#endregion #region Insert value in IncidentHistory Table ,for every update of Page if (statusString.ToLower() == strStatusClose.ToLower()) { objIncidentHistory.Incidentid = incidentid; objIncidentHistory.Operationownerid = userid; objIncidentHistory.Operation = "closed"; objIncidentHistory.Insert(); } else if (statusString.ToLower() == strStatusResolved.ToLower()) { if (Session["ResolutionAdded"] != null) { VarResolutionAdded = Session["ResolutionAdded"].ToString(); } if (VarResolutionAdded == "true") { objIncidentHistory.Incidentid = incidentid; objIncidentHistory.Operationownerid = userid; objIncidentHistory.Operation = "resolved"; objIncidentHistory.Insert(); Session["ResolutionAdded"] = "false"; } else { FlagClosedStatus = false; } //objIncidentHistory.Incidentid = incidentid; //objIncidentHistory.Operationownerid = userid; //objIncidentHistory.Operation = "resolved"; //objIncidentHistory.Insert(); } else { objIncidentHistory.Incidentid = incidentid; objIncidentHistory.Operationownerid = userid; objIncidentHistory.Operation = "update"; objIncidentHistory.Insert(); } #endregion #region Get the Current historyid by calling function Get_Current_IncidentHistoryid() historyid = objIncidentHistory.Get_Current_IncidentHistoryid(); #endregion #region Find Current value of Incident and IncidentStates object ,By Calling Function Get_By_id(),via passing incidentid objIncidentOld = objIncidentOld.Get_By_id(incidentid); objIncidentStatesOld = objIncidentStatesOld.Get_By_id(incidentid); #endregion if (FlagClosedStatus == true) { #region Insert into IncidentHistoryDiff table ,By Comparing Current value and Updated Values if (objIncidentOld.Incidentid != 0 && objIncidentStatesOld.Incidentid != 0) { #region Declare local variable string columnName; string prev_value; string curnt_value; #endregion #region If site value is changed,Insert into IncidentHistoryDiff table if (objIncidentOld.Siteid != Convert.ToInt32(drpSite.SelectedValue)) { columnName = Resources.MessageResource.strColumnSiteid.ToString(); prev_value = Convert.ToString(objIncidentOld.Siteid); curnt_value = drpSite.SelectedValue; objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If Department value is changed,Insert into IncidentHistoryDiff table if (objIncidentOld.Deptid != Convert.ToInt32(drpDepartment.SelectedValue)) { columnName = Resources.MessageResource.strColumnDeptid.ToString(); prev_value = Convert.ToString(objIncidentOld.Deptid); curnt_value = drpDepartment.SelectedValue; objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If Mode value is changed,Insert into IncidentHistoryDiff table if (objIncidentOld.Modeid != Convert.ToInt32(drpMode.SelectedValue)) { columnName = Resources.MessageResource.strColumnModeid.ToString(); prev_value = Convert.ToString(objIncidentOld.Modeid); curnt_value = drpMode.SelectedValue; objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If SLA value is changed,Insert into IncidentHistoryDiff table if (objIncidentOld.Slaid != SLAid) { columnName = Resources.MessageResource.strColumnSLAid.ToString(); prev_value = Convert.ToString(objIncidentOld.Slaid); curnt_value = Convert.ToString(SLAid); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If Requesttype value is changed,Insert into IncidentHistoryDiff table if (objIncidentStatesOld.Requesttypeid != Convert.ToInt32(drpRequestType.SelectedValue)) { columnName = Resources.MessageResource.strColumnRequesttypeid.ToString(); prev_value = Convert.ToString(objIncidentStatesOld.Requesttypeid); curnt_value = Convert.ToString(drpRequestType.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If Priority value is changed,Insert into IncidentHistoryDiff table if (objIncidentStatesOld.Priorityid != Convert.ToInt32(drpPriority.SelectedValue)) { columnName = Resources.MessageResource.strColumnPriorityid.ToString(); prev_value = Convert.ToString(objIncidentStatesOld.Priorityid); curnt_value = Convert.ToString(drpPriority.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If Category value is changed,Insert into IncidentHistoryDiff table if (objIncidentStatesOld.Categoryid != Convert.ToInt32(drpCategory.SelectedValue)) { columnName = Resources.MessageResource.strColumnCategoryid.ToString(); prev_value = Convert.ToString(objIncidentStatesOld.Categoryid); curnt_value = Convert.ToString(drpCategory.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If SubCategory value is changed,Insert into IncidentHistoryDiff table if (objIncidentStatesOld.Subcategoryid != Convert.ToInt32(drpSubcategory.SelectedValue)) { columnName = Resources.MessageResource.strColumnSubcategoryid.ToString(); prev_value = Convert.ToString(objIncidentStatesOld.Subcategoryid); curnt_value = Convert.ToString(drpSubcategory.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region If Status value is changed,Insert into IncidentHistoryDiff table if (objIncidentStatesOld.Statusid != Convert.ToInt32(drpStatus.SelectedValue)) { string Statusprev; string StatusCurrent; columnName = Resources.MessageResource.strColumnstatusid.ToString(); prev_value = Convert.ToString(objIncidentStatesOld.Statusid); curnt_value = Convert.ToString(drpStatus.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); Statusprev = GetStatusString(Convert.ToInt32(objIncidentStatesOld.Statusid)); StatusCurrent = GetStatusString(Convert.ToInt32(drpStatus.SelectedValue)); if (Statusprev.ToLower() == strStatusOpen.ToLower() && StatusCurrent.ToLower() == strStatusOnHold.ToLower()) { columnName = Resources.MessageResource.strColumnStarttime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } if (Statusprev.ToLower() == strStatusOnHold.ToLower() && StatusCurrent.ToLower() != strStatusOnHold.ToLower()) { columnName = Resources.MessageResource.srColumnEndtime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } //Added by lalit //if current techncian is wintel and current status is closed then string prev_valuetechid = Convert.ToString(objIncidentStatesOld.Technicianid); if (StatusCurrent == "Closed") { // if (prev_valuetechid == "11740") if (IsSLANeedsToBeStopped(prev_valuetechid) == 1) { columnName = Resources.MessageResource.srColumnEndtime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } } //end //end lalit } #endregion #region If technician value is changed,Insert into IncidentHistoryDiff table if (objIncidentStatesOld.Technicianid != Convert.ToInt32(drpTechnician.SelectedValue)) { string columnNametechid = Resources.MessageResource.strColumnTechnicianid.ToString(); string prev_valuetechid = Convert.ToString(objIncidentStatesOld.Technicianid); string curnt_valuetechid = Convert.ToString(drpTechnician.SelectedValue); // string Id = ""; //if (curnt_valuetechid == "11740" && prev_valuetechid!="11740") if (IsSLANeedsToBeStopped(curnt_valuetechid) == 1 && IsSLANeedsToBeStopped(prev_valuetechid) == 0) { string StatusCurrent = GetStatusString(Convert.ToInt32(drpStatus.SelectedValue)); if (StatusCurrent.ToLower() != strStatusOnHold.ToLower()) { //insert start time if (StatusCurrent.ToLower() != strStatusOnHold.ToLower()) { columnName = Resources.MessageResource.strColumnStarttime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); //end } //insert techcianid objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnNametechid; objIncidentHistoryDiff.Current_value = curnt_valuetechid; objIncidentHistoryDiff.Prev_value = prev_valuetechid; objIncidentHistoryDiff.Insert(); //end //insert assigntime if (objIncidentStatesOld.AssignedTime == null) { columnName = Resources.MessageResource.strColumnAssignedTime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } else { columnName = "AssignedTime"; prev_value = objIncidentStatesOld.AssignedTime; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } //end } } else { //if prev value- progress eng columnName = Resources.MessageResource.strColumnTechnicianid.ToString(); prev_value = Convert.ToString(objIncidentStatesOld.Technicianid); curnt_value = Convert.ToString(drpTechnician.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); if (objIncidentStatesOld.AssignedTime == null) { columnName = Resources.MessageResource.strColumnAssignedTime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } else { columnName = "AssignedTime"; prev_value = objIncidentStatesOld.AssignedTime; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } // if (prev_valuetechid == "11740") if (IsSLANeedsToBeStopped(prev_valuetechid) == 1) { string StatusCurrent = GetStatusString(Convert.ToInt32(drpStatus.SelectedValue)); if (StatusCurrent.ToLower() != strStatusOnHold.ToLower()) { columnName = Resources.MessageResource.srColumnEndtime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } //end } //then insert end time 0 //end //else //end } if (Convert.ToInt32(drpTechnician.SelectedValue) != 0) { objSentMailtoUser.SentmailTechnician(Convert.ToInt32(drpTechnician.SelectedValue), objIncidentOld.Incidentid); } FlagTechnicianId = true; } #endregion #region If External Ticket value is changed,Insert into IncidentHistoryDiff table if (objIncidentOld.ExternalTicketNo == null) { objIncidentOld.ExternalTicketNo = " "; } if (objIncidentOld.ExternalTicketNo.ToString().Trim() != txtExternalTicket.Text.ToString().Trim()) { //////////////////////////////////////////////////change done by meenakshi int flag = Convert.ToInt32(Session["flag"]); if (flag == 1) { columnName = Resources.MessageResource.strColumnExternalTicket.ToString(); prev_value = objIncidentOld.ExternalTicketNo.ToString().Trim(); txtExternalTicket.Text = (string)Session["compname"]; curnt_value = txtExternalTicket.Text.ToString().Trim(); //curnt_value =(string) Session["compname"]; objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } } #endregion #region If Vendor value is changed,Insert into IncidentHistoryDiff table if (objIncidentOld.VendorId == null) { objIncidentOld.ExternalTicketNo = "0"; } if (objIncidentOld.VendorId != Convert.ToInt32(drpVendor.SelectedValue)) { columnName = Resources.MessageResource.strColumnVendorId.ToString(); prev_value = Convert.ToString(objIncidentOld.VendorId); curnt_value = Convert.ToString(drpVendor.SelectedValue); objIncidentHistoryDiff.Historyid = historyid; objIncidentHistoryDiff.Columnname = columnName; objIncidentHistoryDiff.Current_value = curnt_value; objIncidentHistoryDiff.Prev_value = prev_value; objIncidentHistoryDiff.Insert(); } #endregion #region Check Old status is closed and current status is closed,then Assign value to localvariable FlagCloseStatus=true and used later OldStatusString = GetStatusString(objIncidentStatesOld.Statusid); strCreateDatetime = objIncidentOld.Createdatetime; if (strStatusClose.ToLower() == OldStatusString.ToLower() && statusString.ToLower() == strStatusClose.ToLower()) { FlagCloseStatus = true; oldCompletedTime = objIncidentOld.Completedtime; } #endregion } #endregion } if (FlagClosedStatus == true) { #region Update values in Incident Table objIncident.Incidentid = incidentid; objIncident.Siteid = Convert.ToInt32(drpSite.SelectedValue); objIncident.Deptid = Convert.ToInt32(drpDepartment.SelectedValue); objIncident.Title = lblTitle.Text; objIncident.Description = lblDescription.Text; objIncident.Modeid = Convert.ToInt32(drpMode.SelectedValue); objIncident.Slaid = SLAid; objIncident.Active = true; if (drpAMCCall.Text.ToUpper() == "YES") { objIncident.AMCCall = true; } else if (drpAMCCall.Text.ToUpper() == "NO") { objIncident.AMCCall = false; } /////////////////////////////////////////////////////////////////change done by meenakshi///////////////////////// //objIncident.ExternalTicketNo = txtExternalTicket.Text.ToString().Trim(); objIncident.ExternalTicketNo = (string)(Session["compname"]); /////////////////////////////////////////////////////////////////end///////////////////////////////// objIncident.VendorId = Convert.ToInt32(drpVendor.SelectedValue); //#region If Current status is closed,then Assign Completed time #region If Current status is resolved,then Assign Completed time if (statusString.ToLower() == strStatusResolved.ToLower()) { #region If FlagCloseStatus=flase ie Currrent status is closed ,and old status is not Closed if (FlagCloseStatus == false) { objIncident.Completedtime = DateTime.Now.ToString(); varTotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(incidentid, Convert.ToInt32(drpSite.SelectedValue), strCreateDatetime, DateTime.Now.ToString()); } else { objIncident.Completedtime = oldCompletedTime; varTotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(incidentid, Convert.ToInt32(drpSite.SelectedValue), strCreateDatetime, oldCompletedTime); } #endregion } //added by lalit 27 march if (statusString.ToLower() == strStatusClose.ToLower()) { #region If FlagCloseStatus=flase ie Currrent status is closed ,and old status is not Closed varTotalTimeSpentonCall = objIncident.Timespentonreq; objIncident.Completedtime = oldCompletedTime; #endregion } //end lalit if (varTotalTimeSpentonCall <= 0) { varTotalTimeSpentonCall = 0; } if (lblextension.Text != "") { objIncident.Extension = Convert.ToInt64(lblextension.Text); } //if (lblAMCcall.Text != "") //{ // objIncident.AMCCall = Convert.ToInt32(lblAMCcall.Text); //} objIncident.Timespentonreq = varTotalTimeSpentonCall; objIncident.Update(); //if (statusString.ToLower() == strStatusClose.ToLower() && FlagClosedStatus == true) if (statusString.ToLower() == strStatusResolved.ToLower() && FlagClosedStatus == true) { objSentMailtoUser.SentmailUser(objIncidentOld.Requesterid, objIncidentOld.Incidentid, "closed"); } #endregion #endregion } if (FlagClosedStatus == true) { #region Update Values in IncidentStates objIncidentStates.Incidentid = incidentid; objIncidentStates.Categoryid = Convert.ToInt32(drpCategory.SelectedValue); objIncidentStates.Subcategoryid = Convert.ToInt32(drpSubcategory.SelectedValue); objIncidentStates.Technicianid = Convert.ToInt32(drpTechnician.SelectedValue); if (FlagTechnicianId == true) { objIncidentStates.AssignedTime = DateTime.Now.ToString(); } objIncidentStates.Statusid = Convert.ToInt32(drpStatus.SelectedValue); objIncidentStates.Priorityid = Convert.ToInt32(drpPriority.SelectedValue); objIncidentStates.Requesttypeid = Convert.ToInt32(drpRequestType.SelectedValue); objIncidentStates.Update(); #endregion } #region Callint Updatepanel1() function to display value in Non Editable Mode UpdatePanel1(); #endregion HistoryUpdatePanel(); }
public int Update_Incident_mst_By_id(Incident_mst objIncident) { return (int)ExecuteNonQuery(Sp_Incident_Update, new object[] { objIncident.Title, objIncident.Timespentonreq, objIncident.Slaid, objIncident.Siteid, objIncident.Requesterid, objIncident.Modeid, objIncident.Incidentid, objIncident.Description, objIncident.Deptid, objIncident.Createdbyid, objIncident.Createdatetime, objIncident.Extension, objIncident.Completedtime, objIncident.ExternalTicketNo, objIncident.VendorId, objIncident.Active, objIncident.AMCCall }); }
protected void SendEmail(int incidentid, int level,int slaid) { SentEmail objEmail = new SentEmail(); #region Sent Mail for Level 1 Escalation if (level==1) { objLevel1 = objLevel1.Get_By_Slaid(slaid); if (objLevel1!=null ) { string varemail = objLevel1.Emailid; string[] arrEmail = varemail.Split(','); int lengthCount = Convert.ToInt16(arrEmail.Length.ToString()); for (int i = 0; i < lengthCount - 1; i++) { string emailId = arrEmail[i].ToString(); if (emailId != "," && emailId!="") { objIncident = objIncident.Get_By_id(incidentid); if (objIncident!=null) { objCheckLevel1 = objCheckLevel1.Get_By_id(incidentid); if (objCheckLevel1.Incidentid ==0) { CheckLevel1Escalate obj = new CheckLevel1Escalate(); obj.Incidentid = incidentid; obj.Level1escalate = true; obj.Insert(); objEmail.To = emailId; objEmail.From = Resources.MessageResource.strEmailFromLevel1Escalate.ToString(); objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title; objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards Admin"; objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString(); objEmail.SentMail(); } } } } } } #endregion #region Sent Mail for Level 2 Escalation if (level == 2) { objLevel2 = objLevel2.Get_By_Slaid(slaid); if (objLevel2.Slaid != 0) { string varemail = objLevel2.Emailid; string[] arrEmail = varemail.Split(','); int lengthCount = Convert.ToInt16(arrEmail.Length.ToString()); for (int i = 0; i < lengthCount - 1; i++) { string emailId = arrEmail[i].ToString(); if (emailId != "," && emailId != "") { objIncident = objIncident.Get_By_id(incidentid); if (objIncident != null) { objCheckLevel2 = objCheckLevel2.Get_By_id(incidentid); if (objCheckLevel2.Incidentid == 0) { CheckLevel2Escalate obj = new CheckLevel2Escalate(); obj.Incidentid = incidentid; obj.Level2escalate = true; obj.Insert(); objEmail.To = emailId; objEmail.From = Resources.MessageResource.strEmailFromLevel2Escalate.ToString(); objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title; objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards <br/> Admin"; objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString(); objEmail.SentMail(); } } } } } } #endregion #region Sent Mail for Level 3 Escalation if (level == 3) { objLevel3 = objLevel3.Get_By_Slaid(slaid); if (objLevel3.Slaid != 0) { string varemail = objLevel3.Emailid; string[] arrEmail = varemail.Split(','); int lengthCount = Convert.ToInt16(arrEmail.Length.ToString()); for (int i = 0; i < lengthCount - 1; i++) { string emailId = arrEmail[i].ToString(); if (emailId != "," && emailId != "") { objIncident = objIncident.Get_By_id(incidentid); if (objIncident != null) { objCheckLevel3 = objCheckLevel3.Get_By_id(incidentid); if (objCheckLevel3.Incidentid == 0) { CheckLevel3Escalate obj = new CheckLevel3Escalate(); obj.Incidentid = incidentid; obj.Level3escalate = true; obj.Insert(); objEmail.To = emailId; objEmail.From = Resources.MessageResource.strEmailFromLevel3Escalate.ToString(); objEmail.Subject = "Problem Not Resolve for Call -" + objIncident.Title; objEmail.Body = "Dear Sir, The Current Request is not Solved whose Incident Id is " + objIncident.Incidentid + " and Title of Call is " + objIncident.Title + " Thanks & Regards Admin"; objEmail.SmtpServer = Resources.MessageResource.strMailServer.ToString(); objEmail.SentMail(); } } } } } } #endregion }
protected void btnApprove_Click(object sender, EventArgs e) { ObjChangeApproveTrans.Changeid =Convert.ToInt16(Request.QueryString[0]); ObjChangeApproveTrans.Approvalcomment = txtcomment.Text.ToString(); ObjChangeApproveTrans.ApproverName =Request.QueryString[1]; int changestatusid=Objchangestatus.Get_By_StatusName(Resources.MessageResource.StrApproved); ObjChangeApproveTrans.Approvestatus=changestatusid; ObjChangeApproveTrans.Insert(); Change_mst Obj = new Change_mst(); Obj=Obj.Get_By_id(Convert.ToInt16(Request.QueryString[0])); ObjChange.Statusid = changestatusid; ObjChange.Changeid = Convert.ToInt16(Request.QueryString[0]); ObjChange.Active =true; ObjChange.Assignetime = Obj.Assignetime; ObjChange.Categoryid =Obj.Categoryid ; ObjChange.Changetype = Obj.Changetype; ObjChange.Subcategoryid = Obj.Subcategoryid; ObjChange.Technician = Obj.Technician; ObjChange.Title = Obj.Title; //ObjChange.Completedtime = ""; ObjChange.CreatedByID = Obj.CreatedByID; ObjChange.Description = Obj.Description; ObjChange.Priority = Obj.Priority; ObjChange.Requestedby = Obj.Requestedby; ObjChange.Sceduledstarttime = Obj.Sceduledstarttime; ObjChange.Sceduledendtime = Obj.Sceduledendtime; ObjChange.Approvalstatus = Obj.Approvalstatus; ObjChange.Impact = Obj.Impact; ObjChange.Update(); Change_mst ObjNewChange = new Change_mst(); ObjNewChange = ObjNewChange.Get_By_id(Convert.ToInt16(Request.QueryString[0])); string approvalrequest=Resources.MessageResource.StrApproved.ToString(); int modeid = ObjMode.Get_Mode_By_Mname("Email"); if(approvalrequest=="Approved") { BLLCollection<Incident_To_Change> colIncToChng = new BLLCollection<Incident_To_Change>(); colIncToChng=Objincidenttochange.Get_All_By_Changeid(ObjNewChange.Changeid); int FlagStatus=0; foreach (Incident_To_Change obj in colIncToChng) { FlagStatus = FlagStatus + 1; } if (FlagStatus == 0) { string statusname = Resources.MessageResource.strStatusOpen.ToString(); int statusid = Convert.ToInt16(Objstatus.Get_By_StatusName(statusname)); Objincludeassetinchange = Objincludeassetinchange.Get_By_Changeid(ObjNewChange.Changeid); Objconfiguration = Objconfiguration.Get_By_id(Objincludeassetinchange.Assetid); int priorityid = Convert.ToInt16(Objconfiguration.Severity); Incident_mst Objincident = new Incident_mst(); int slaid = Objincident.Get_By_SLAid(Objconfiguration.Siteid, priorityid); Objincident.Requesterid = ObjNewChange.Requestedby; Objincident.Title = ObjNewChange.Title; Objincident.Siteid = Objconfiguration.Siteid; Objincident.Createdbyid = ObjNewChange.CreatedByID; Objincident.Slaid = Convert.ToInt16(slaid); Objincident.Modeid = modeid; Objincident.Insert(); int incidentid = Objincident.Get_Current_Incidentid(); IncidentStates Objincidentstattes = new IncidentStates(); Objincidentstattes.Incidentid = incidentid; Objincidentstattes.Priorityid = Convert.ToInt16(Objconfiguration.Severity); Objincidentstattes.Subcategoryid = ObjNewChange.Subcategoryid; Objincidentstattes.Categoryid = ObjNewChange.Categoryid; Objincidentstattes.Statusid = statusid; Objincidentstattes.Requesttypeid = 2; Objincidentstattes.Insert(); objincidenthistory.Incidentid = incidentid; objincidenthistory.Operation = "create"; objincidenthistory.Operationownerid = ObjNewChange.CreatedByID; objincidenthistory.Insert(); Objincidenttochange.Changeid = ObjNewChange.Changeid; Objincidenttochange.Incidentid = incidentid; Objincidenttochange.Insert(); string myScript; myScript = "<script language=javascript>CloseWindow();</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); } } }
protected void Bindgrid() { #region Declaration of table Variable DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); #endregion int problemid = Convert.ToInt16(Request.QueryString[0]); colIncidentToProblem = objIncidentToProblem.Get_All_By_Problemid(problemid); if (colIncidentToProblem.Count == 0) { DataRow row; row = dtTable.NewRow(); row["ID"] = ""; row["title"] = ""; row["requesterid"] = ""; row["technicianid"] = ""; row["statusid"] = ""; row["createdatetime"] = ""; dtTable.Rows.Add(row); } foreach (Incident_To_Problem obj in colIncidentToProblem) { int id = Convert.ToInt16(obj.Incidentid); objIncident = objIncident.Get_By_id(id); DataRow row; row = dtTable.NewRow(); // row["incidentid"] = Convert.ToString(objIncident.Incidentid); row["ID"] = objIncident.Incidentid; row["title"] = objIncident.Title; row["requesterid"] = Convert.ToString(objIncident.Requesterid); row["technicianid"] = objIncidentStates.Technicianid; objIncidentStates = objIncidentStates.Get_By_id(objIncident.Incidentid); row["statusid"] = objIncidentStates.Statusid; row["createdatetime"] = Convert.ToString(objIncident.Createdatetime); //row["createdbyid"] = Convert.ToString(objIncident.Createdbyid); //row["siteid"] = Convert.ToString(objIncident.Siteid); //row["priorityid"] = objIncidentStates.Priorityid; dtTable.Rows.Add(row); } grdvwincidentproblem.DataSource = dtTable; grdvwincidentproblem.DataBind(); //#region Fetch Each object of type Incident_mst from Collection Incident_mst //foreach (Incident_mst objIncident in col) //{ // #region Create Table row and assign value to it // DataRow row; // row = dtTable.NewRow(); // // row["incidentid"] = Convert.ToString(objIncident.Incidentid); // row["title"] = objIncident.Title; // row["requesterid"] = Convert.ToString(objIncident.Requesterid); // row["technicianid"] = objIncidentStates.Technicianid; // objIncidentStates = objIncidentStates.Get_By_id(objIncident.Incidentid); // row["statusid"] = objIncidentStates.Statusid; // row["createdatetime"] = Convert.ToString(objIncident.Createdatetime); // //row["createdbyid"] = Convert.ToString(objIncident.Createdbyid); // //row["siteid"] = Convert.ToString(objIncident.Siteid); // //row["priorityid"] = objIncidentStates.Priorityid; // dtTable.Rows.Add(row); // #endregion //} //#endregion }
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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>EstimatedResolutionTime :</b> " + GetResolutionTimeInHours(objIncident.Slaid) + "<br/><b>Email Address :</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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "<br/><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</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 <b>" + objtech.Username + "</b> on <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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</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 <b>" + objtech.Username + "</b> on <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 :</b> " + incidentid + "<br/><b>Site :</b> " + objSite.Sitename + "<br/><b>Logged Date & Time :</b> " + objIncident.Createdatetime + "<br/><b>Closed Date & Time :</b> " + objIncident.Completedtime + "<br/><b>Description :</b> " + objIncident.Description + "<br/><b>Resolution :</b> " + objIncidentResolution.Resolution + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>Username :</b> " + objUser.Username + "<br/><b>Email Address :</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 <b>" + objtech.Username + "</b> on <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 :</b>" + incidentid + "<br/><b>Title of Call :</b>" + objIncident.Title + " <br/><b>Site :</b>" + objSite.Sitename + "</br><b>Logged Date & Time   :</b>" + objIncident.Createdatetime + "<br/><b>Description :</b>" + objIncident.Description + "<br/><b>Priority :</b> " + objPriority.Name + "<br/><b>UserName :</b>" + objUser.Username + "<br/><b>Mail Address :</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 btnUpdate_Click(object sender, EventArgs e) { #region Get problemid from QueryString int problemid = Convert.ToInt16(Request.QueryString[0]); #endregion #region Declare Local Variable // Declare local Variable int historyid; int varTotalTimeSpentonCall = 0; int SLAid; string userName; int userid = 0; string strCreateDatetime = ""; string statusString; string strStatusOpen; string strStatusClose; string strStatusResolved; string strStatusOnHold; bool FlagTechnicianId; bool FlagCloseStatus; int requesttypeid; string OldStatusString; FlagTechnicianId = false; FlagCloseStatus = false; string oldCompletedTime = ""; Incident_mst objIncidentOld = new Incident_mst(); Problem_mst objproblemstatusold = new Problem_mst(); objproblemstatusold = objproblemstatusold.Get_By_id(problemid); string VarResolutionAdded = ""; #endregion #region Fetch Current User // Fetch Current User and assign to local variable userName MembershipUser User = Membership.GetUser(); userName = User.UserName.ToString(); #endregion #region Fetch Data from MessageResource file and assign to Local Variable statusString = GetStatusString(Convert.ToInt16(drpStatus.SelectedValue)); strStatusOpen = Resources.MessageResource.strStatusOpen.ToString().Trim(); strStatusClose = Resources.MessageResource.strStatusClose.ToString().Trim(); strStatusResolved = Resources.MessageResource.strStatusResolved.ToString().Trim(); strStatusOnHold = Resources.MessageResource.strStatusOnHold.ToString().Trim(); #endregion #region On the basis of Username ,get Userid by calling Function Get_UserLogin_By_UserName(),via passing parameter Username and organizationid if (userName != "") { Objorganization = Objorganization.Get_Organization(); ObjUser = ObjUser.Get_UserLogin_By_UserName(userName, Objorganization.Orgid); if (ObjUser.Userid != 0) { userid = ObjUser.Userid; } } #endregion #region Insert value in IncidentHistory Table ,for every update of Page if (statusString.ToLower() == strStatusClose.ToLower()) { ObjProblemHistory.Problemid = problemid; ObjProblemHistory.Operationownerid = userid; ObjProblemHistory.Operation = "closed"; ObjProblemHistory.Insert(); } else if (statusString.ToLower() == strStatusResolved.ToLower()) { ObjProblemHistory.Problemid = problemid; ObjProblemHistory.Operationownerid = userid; ObjProblemHistory.Operation = "resolved"; ObjProblemHistory.Insert(); } else { ObjProblemHistory.Problemid = problemid; ObjProblemHistory.Operationownerid = userid; ObjProblemHistory.Operation = "update"; ObjProblemHistory.Insert(); } #endregion #region Get the Current historyid by calling function Get_Current_ProblemHistoryid() historyid = ObjProblemHistory.Get_Current_ProblemHistoryid(); #endregion #region Find Current value of Problem aBy Calling Function Get_By_id(),via passing problemid ObjProblem = ObjProblem.Get_By_id(problemid); #endregion #region Insert into IncidentHistoryDiff table ,By Comparing Current value and Updated Values if (ObjProblem.ProblemId != 0) { #region Declare local variable string columnName; string prev_value; string curnt_value; #endregion #region If Priority value is changed,Insert into IncidentHistoryDiff table if (ObjProblem.Priorityid != Convert.ToInt16(drpPriority.SelectedValue)) { columnName = Resources.MessageResource.strColumnPriorityid.ToString(); prev_value = Convert.ToString(ObjProblem.Priorityid); curnt_value = Convert.ToString(drpPriority.SelectedValue); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } #endregion #region If Category value is changed,Insert into IncidentHistoryDiff table if (ObjProblem.Categoryid != Convert.ToInt16(drpCategory.SelectedValue)) { columnName = Resources.MessageResource.strColumnCategoryid.ToString(); prev_value = Convert.ToString(ObjProblem.Categoryid); curnt_value = Convert.ToString(drpCategory.SelectedValue); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } #endregion #region If SubCategory value is changed,Insert into IncidentHistoryDiff table if (ObjProblem.Subcategoryid != Convert.ToInt16(drpSubcategory.SelectedValue)) { columnName = Resources.MessageResource.strColumnSubcategoryid.ToString(); prev_value = Convert.ToString(ObjProblem.Subcategoryid); curnt_value = Convert.ToString(drpSubcategory.SelectedValue); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } #endregion #region If Status value is changed,Insert into IncidentHistoryDiff table if (ObjProblem.Statusid != Convert.ToInt16(drpStatus.SelectedValue)) { string Statusprev; string StatusCurrent; columnName = Resources.MessageResource.strColumnstatusid.ToString(); prev_value = Convert.ToString(ObjProblem.Statusid); curnt_value = Convert.ToString(drpStatus.SelectedValue); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); Statusprev = GetStatusString(Convert.ToInt16(objproblemstatusold.Statusid)); StatusCurrent = GetStatusString(Convert.ToInt16(drpStatus.SelectedValue)); if (Statusprev == strStatusOpen && StatusCurrent == strStatusOnHold) { columnName = Resources.MessageResource.strColumnStarttime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } if (Statusprev == strStatusOnHold && StatusCurrent != strStatusOnHold) { columnName = Resources.MessageResource.srColumnEndtime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } } #endregion #region If technician value is changed,Insert into IncidentHistoryDiff table if (ObjProblem.Technicianid != Convert.ToInt16(drpTechnician.SelectedValue)) { columnName = Resources.MessageResource.strColumnTechnicianid.ToString(); prev_value = Convert.ToString(ObjProblem.Technicianid); curnt_value = Convert.ToString(drpTechnician.SelectedValue); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); objSentMailToUser.SentMailToTechnicianForProblemCall(problemid, Convert.ToInt16(drpTechnician.SelectedValue)); if (objproblemstatusold.AssginedTime == null) { columnName = Resources.MessageResource.strColumnAssignedTime.ToString(); prev_value = "0"; curnt_value = DateTime.Now.ToString(); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } else { columnName = "AssignedTime"; prev_value = objproblemstatusold.AssginedTime; curnt_value = DateTime.Now.ToString(); ObjProblemHistoryDiff.Historyid = historyid; ObjProblemHistoryDiff.Columnname = columnName; ObjProblemHistoryDiff.Current_value = curnt_value; ObjProblemHistoryDiff.Prev_value = prev_value; ObjProblemHistoryDiff.Insert(); } FlagTechnicianId = true; } #endregion } #endregion #region Update values in Problem Table ObjProblemnew.ProblemId = problemid; ObjProblemnew.Technicianid = Convert.ToInt16(drpTechnician.SelectedValue); ObjProblemnew.Statusid = Convert.ToInt16(drpStatus.SelectedValue); ObjProblemnew.Priorityid = Convert.ToInt16(drpPriority.SelectedValue); ObjProblemnew.Categoryid = Convert.ToInt16(drpCategory.SelectedValue); ObjProblemnew.Subcategoryid = Convert.ToInt16(drpSubcategory.SelectedValue); ObjProblemnew.Active = true; if (ObjProblem.Technicianid != Convert.ToInt16(drpTechnician.SelectedValue)) { ObjProblemnew.AssginedTime = DateTime.Now.ToString(); } else { ObjProblemnew.AssginedTime = ObjProblem.AssginedTime; } #region If Current status is closed,then Assign Completed time if (statusString.ToLower() == strStatusClose.ToLower()) { #region If FlagCloseStatus=flase ie Currrent status is closed ,and old status is not Closed int status = ObjProblem.Statusid; ObjStatus = ObjStatus.Get_By_id(status); if (ObjStatus.Statusname == "closed") { ObjProblemnew.Closedatetime = ObjProblem.Closedatetime; // varTotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(incidentid, Convert.ToInt16(drpSite.SelectedValue), strCreateDatetime, DateTime.Now.ToString()); //CalculateTotalTimeofRequest(); //varTotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(strCreateDatetime, DateTime.Now.ToString()); } else { ObjProblemnew.Closedatetime = DateTime.Now.ToString(); //varTotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(strCreateDatetime, oldCompletedTime); // varTotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(incidentid, Convert.ToInt16(drpSite.SelectedValue), strCreateDatetime, oldCompletedTime); } #endregion } #endregion ObjProblemnew.Update(); #endregion Showproblempanal(); LogNoteUpdatePanel(); HistoryUpdatePanel(); }
protected void grdvwRequest_RowDataBound(Object sender, GridViewRowEventArgs e) { 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.ToInt16(((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.ToInt16(e.Row.Cells[3].Text); objUser = objUser.Get_By_id(requesterid); if (objUser.Userid != 0) { e.Row.Cells[3].Text = objUser.Username.ToString(); } else { e.Row.Cells[3].Text = ""; } #endregion #region Bind Datarow at Run Time with Createdbyid to Created by name int createdbyid = Convert.ToInt16(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.ToInt16(e.Row.Cells[5].Text); objUser = objUser.Get_By_id(technicianid); if (objUser.Userid != 0) { e.Row.Cells[5].Text = objUser.Username.ToString(); } else { e.Row.Cells[5].Text = ""; } #endregion #region Bind Datarow at run time with Statusid to Status int statusid = Convert.ToInt16(e.Row.Cells[6].Text); objStatus = objStatus.Get_By_id(statusid); if (objStatus.Statusid != 0) { e.Row.Cells[6].Text = objStatus.Statusname.ToString(); } else { e.Row.Cells[6].Text = ""; } #endregion #region Bind Datarow at run time with Priorityid to Priority int priorityid = Convert.ToInt16(e.Row.Cells[7].Text); objPriority = objPriority.Get_By_id(priorityid); if (objPriority.Priorityid != 0) { e.Row.Cells[7].Text = objPriority.Name.ToString(); } else { e.Row.Cells[7].Text = ""; } #endregion #region Bind Datarow at run time with Siteid to Site int siteid = Convert.ToInt16(e.Row.Cells[8].Text); objSite = objSite.Get_By_id(siteid); if (objSite.Siteid != 0) { string custSiteName; int custid = 0; colCustToSite = objCustToSite.Get_All_By_siteid(objSite.Siteid); foreach (CustomerToSiteMapping objCuToSite in colCustToSite) { custid = objCuToSite.Custid; } objCustomer = objCustomer.Get_By_id(custid); e.Row.Cells[8].Text = objCustomer.Customer_name + "/" + objSite.Sitename.ToString(); } else { e.Row.Cells[8].Text = ""; } #endregion #region Apply Color Coding to Open Calls,According to define SLA if (varStatusOpen.ToLower() == objStatus.Statusname.ToString().ToLower()) { Incident_mst obj = new Incident_mst(); obj = obj.Get_By_id(varIncidentid); if (obj.Incidentid != 0) { if (obj.Slaid != 0) { #region Declare local variables,and objects of various classes int percent; ProcessEscalateEmail objPro = new ProcessEscalateEmail(); #endregion #region Get Total Resolution time define for particular SLA and Time Spent on Request TotalResolutionTime = objPro.GetResolutionTimeInMins(obj.Slaid); TotalTimeSpentonCall = objIncident.Get_TimeSpentonRequest(varIncidentid, siteid, varCreateDatetime, DateTime.Now.ToString()); if (TotalTimeSpentonCall < 0) { TotalTimeSpentonCall = 0; } #endregion #region Calculate Percent percent = (TotalTimeSpentonCall * 100) / TotalResolutionTime; #endregion ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusOpen); foreach (ColorScheme_mst objCol in colColor) { if (objCol.Percnt_to != 0) { if (percent >= objCol.Percnt && percent <= objCol.Percnt_to) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } else { if (percent >= objCol.Percnt) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } } } else { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus("NonSLA"); foreach (ColorScheme_mst objCol in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(objCol.Colorname); } } } } #endregion #region Apply Color Coding to Close Calls if (varStatusClose.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusClose); foreach (ColorScheme_mst obj in colColor) { try { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } catch (Exception ex) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString("White"); } } } #endregion #region Apply Color Coding to On Hold Calls if (varStatusOnHold.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusOnHold); foreach (ColorScheme_mst obj in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } } #endregion #region Apply Color Coding to Resolved Calls if (varStatusResolved.ToLower() == objStatus.Statusname.ToString().ToLower()) { ColorScheme_mst objColor = new ColorScheme_mst(); colColor = objColor.Get_All_By_CallStatus(varStatusResolved); foreach (ColorScheme_mst obj in colColor) { e.Row.BackColor = (System.Drawing.Color)colConvert.ConvertFromString(obj.Colorname); } } #endregion } }
protected void UpdatePanel1() { pan1.Visible = true; pan2.Visible = false; lnkEdit.Visible = true; btnCancel.Visible = false; btnUpdate.Visible = false; int incidentid = Convert.ToInt16(Request.QueryString[0]); if (incidentid != 0) { Session["incidentid"] = incidentid; lblIncidentId.Text = incidentid.ToString(); objIncident = objIncident.Get_By_id(incidentid); if (objIncident.Incidentid != 0) { ViewState["CreatedbyId"] = Convert.ToString(objIncident.Createdbyid); objIncidentStates = objIncidentStates.Get_By_id(incidentid); if (objIncidentStates.Incidentid != 0) { string status = Resources.MessageResource.strStatusOnHold.ToString(); lblCalltype.Text = GetRequestTypeName(objIncidentStates.Requesttypeid); //lblImpact.Text = GetImpactString(objIncidentStates.Impactid); lblStatus.Text = GetStatusString(objIncidentStates.Statusid); lblMode.Text = GetModeString(objIncident.Modeid); lblPriority.Text = GetPriorityString(objIncidentStates.Priorityid); lblSLA.Text = GetSLAName(objIncident.Slaid); lblSite.Text = GetSiteName(objIncident.Siteid); lblDept.Text = GetDepartmentName(objIncident.Deptid); lblCategory.Text = GetCategoryName(objIncidentStates.Categoryid); lblSubCategory.Text = GetSubCategoryName(objIncidentStates.Subcategoryid); lblTechnician.Text = GetUsername(objIncidentStates.Technicianid); lblCreatedbyPanel2.Text = GetUsername(objIncident.Createdbyid); lblReportedDate.Text = objIncident.Reporteddatetime; //lblReportedTime.Text = objIncident.Reporteddatetime; lblRequesterDisp.Text = GetUsername(objIncident.Requesterid); lblDateDisp.Text = objIncident.Createdatetime.ToString().Trim(); lblCreateddatePanel2.Text = objIncident.Createdatetime.ToString().Trim(); if (objIncident.ExternalTicketNo != null) { lblExternalTicket.Text = objIncident.ExternalTicketNo.ToString().Trim(); } lblVendor.Text = GetVendorName(Convert.ToInt16(objIncident.VendorId.ToString())); if (objIncident.Completedtime != null) { lblCompletedDate.Text = objIncident.Completedtime.ToString().Trim(); lbltimespentonDisp.Visible = true; int varTimeSpentonCall = 0; varTimeSpentonCall = Convert.ToInt16(objIncident.Timespentonreq.ToString()); if (varTimeSpentonCall < 60) { lbltimespentonreq.Text = varTimeSpentonCall.ToString() + " min"; } else { int hr; int min; hr = varTimeSpentonCall / 60; min = varTimeSpentonCall % 60; lbltimespentonreq.Text = hr + " hr" + ":" + min + " min"; } } else { lblCompletedDate.Text = "-"; } lblTitle.Text = objIncident.Title; lblDescription.Text = objIncident.Description; } } } }
protected void btnDelete_Click(object sender, EventArgs e) { /////Add Exception handilng try catch change by vishal 21-05-2012 try { foreach (GridViewRow gv in grdvwRequest.Rows) { string gvIDs; // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // If deleteChkBxItem is Checked then ,mapped Current site to this user if (deleteChkBxItem.Checked) { int incidentid; int varSiteid = 0; // Get the Site Id from variable of Label type declare in GridView of grdvwSite gvIDs = ((Label)gv.FindControl("incidentid")).Text.ToString(); incidentid = Convert.ToInt32(gvIDs); // Check if gvIDs is not null if (gvIDs != "") { Incident_mst objInc_mst = new Incident_mst(); objInc_mst = objIncident.Get_By_id(incidentid); objInc_mst.Active = false; objInc_mst.Update(); if (drpSite.SelectedValue != "") { varSiteid = Convert.ToInt32(drpSite.SelectedValue); } if (varSiteid == 0) { BindGridForAllParameter(); } else { BindGridForSelectedParameter(); } } } } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void btnDelete_Click(object sender, EventArgs e) { foreach (GridViewRow gv in grdvwRequest.Rows) { string gvIDs; // Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // If deleteChkBxItem is Checked then ,mapped Current site to this user if (deleteChkBxItem.Checked) { int incidentid; int varSiteid=0; // Get the Site Id from variable of Label type declare in GridView of grdvwSite gvIDs = ((Label)gv.FindControl("incidentid")).Text.ToString(); incidentid = Convert.ToInt16(gvIDs); // Check if gvIDs is not null if (gvIDs != "") { Incident_mst objInc_mst= new Incident_mst(); objInc_mst = objIncident.Get_By_id(incidentid); objInc_mst.Active = false ; objInc_mst.Update(); if (drpSite.SelectedValue != "") { varSiteid = Convert.ToInt16(drpSite.SelectedValue); } if (varSiteid == 0) { BindGridForAllParameter(); } else { BindGridForSelectedParameter(); } } } } }
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 object GenerateIncident_mstObject(ref IDataReader returnData) { Incident_mst obj = new Incident_mst(); while (returnData.Read()) { obj.Incidentid = (int)returnData["Incidentid"]; obj.Title = (String)returnData["Title"]; obj.Timespentonreq = (int)returnData["Timespentonreq"]; obj.Slaid = (int)returnData["Slaid"]; obj.Siteid = (int)returnData["Siteid"]; obj.Requesterid = (int)returnData["Requesterid"]; obj.Modeid = (int)returnData["Modeid"]; if (returnData["Description"] != DBNull.Value) { obj.Description = (String)returnData["Description"]; } obj.Deptid = (int)returnData["Deptid"]; obj.Createdbyid = (int)returnData["Createdbyid"]; DateTime Mydatetime = new DateTime(); Mydatetime = (DateTime)returnData["Createdatetime"]; obj.Createdatetime = Mydatetime.ToString(); if (returnData["Reporteddatetime"] != DBNull.Value) { DateTime reporteddatetime = new DateTime(); reporteddatetime = (DateTime)returnData["Reporteddatetime"]; // By Prachi, Date 29-Dec-2011 // bug :select time also in reported date //obj.Reporteddatetime = reporteddatetime.ToString("dd/MM/yyyy hh:mm:ss "); obj.Reporteddatetime = reporteddatetime.ToString("dd/MM/yyyy hh:mm:ss tt"); } DateTime Complettime = new DateTime(); if (returnData["Completedtime"] != DBNull.Value) { Complettime = (DateTime)returnData["Completedtime"]; obj.Completedtime = Complettime.ToString(); } if (returnData["ExternalTicketNo"] != DBNull.Value) { obj.ExternalTicketNo = (String)returnData["ExternalTicketNo"]; } if (returnData["VendorId"] != DBNull.Value) { obj.VendorId = (int)returnData["VendorId"]; } } returnData.Close(); returnData.Dispose(); return obj; }