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(); } } }
protected void btnUpdate_Click(object sender, EventArgs e) { //Add Exception handilng try catch change by vishal 21-05-2012 try { # region Declare Local Variable string StrStatusRequested; string StrStatusRejected; string StrStatusApproval; string StrStatusApproved; string StrStatusPlanning; string StrStatusTesting; string StrStatusRelease; string StrStatusImplemented; string StrStatusCompleted; string StrStatusString = ""; int userid = 0; int changeid = Convert.ToInt32(Request.QueryString[0]); string userName = ""; #endregion #region Fetch the Status Value from Resource File StrStatusString = GetChangeStatusString(Convert.ToInt32(drpStatus.SelectedValue)); StrStatusRejected = Resources.MessageResource.StrRejected.ToString(); StrStatusApproval = Resources.MessageResource.StrApproval.ToString(); StrStatusRequested = Resources.MessageResource.StrRequested.ToString(); StrStatusApproved = Resources.MessageResource.StrApproved.ToString(); StrStatusPlanning = Resources.MessageResource.StrPlanning.ToString(); StrStatusTesting = Resources.MessageResource.StrTesting.ToString(); StrStatusRelease = Resources.MessageResource.StrRelease.ToString(); StrStatusImplemented = Resources.MessageResource.StrImplemented.ToString(); StrStatusCompleted = Resources.MessageResource.StrCompleted.ToString(); #endregion MembershipUser User = Membership.GetUser(); userName = User.UserName.ToString(); #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 Historyvalue in Change History Table int result = String.Compare(StrStatusString, StrStatusRequested, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Requested"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusRejected, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Rejected"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusApproval, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Approval"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusApproved, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Approved"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusPlanning, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Planning"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusTesting, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Testing"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusRelease, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Release"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusImplemented, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Implemented"; ObjChangeHistory.Insert(); } result = String.Compare(StrStatusString, StrStatusCompleted, true); if (result == 0) { ObjChangeHistory.Changeid = changeid; ObjChangeHistory.Operationownerid = userid; ObjChangeHistory.Operation = "Completed"; ObjChangeHistory.Insert(); } #endregion #region Get the Current historyid by calling function Get_Current_ProblemHistoryid() int historyid = ObjChangeHistory.Get_Current_ChangeHistoryid(); #endregion #region Find Current value of Problem aBy Calling Function Get_By_id(),via passing problemid ObjChange = ObjChange.Get_By_id(changeid); #endregion #region Insert into ChangeHistoryDiff table ,By Comparing Current value and Updated Values if (ObjChange.Changeid != 0) { #region Declare local variable string columnName; string prev_value; string curnt_value; #endregion #region If Priority value is changed,Insert into ChangeHistoryDiff table if (ObjChange.Priority != Convert.ToInt32(drpPriority.SelectedValue)) { columnName = Resources.MessageResource.strColumnPriorityid.ToString(); prev_value = Convert.ToString(ObjChange.Priority); curnt_value = Convert.ToString(drpPriority.SelectedValue); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = columnName; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); } #endregion #region If Technician value is changed,Insert into ChangeHistoryDiff table if (ObjChange.Technician != Convert.ToInt32(drpTechnician.SelectedValue)) { columnName = Resources.MessageResource.strColumnTechnicianid.ToString(); prev_value = Convert.ToString(ObjChange.Technician); curnt_value = Convert.ToString(drpTechnician.SelectedValue); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = columnName; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); } #endregion #region If category value is changed,Insert into ChangeHistoryDiff table if (ObjChange.Categoryid != Convert.ToInt32(drpCategory.SelectedValue)) { columnName = Resources.MessageResource.strColumnCategoryid.ToString(); prev_value = Convert.ToString(ObjChange.Categoryid); curnt_value = Convert.ToString(drpCategory.SelectedValue); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = columnName; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); } #endregion #region If Subcategory value is changed,Insert into ChangeHistoryDiff table if (ObjChange.Subcategoryid != Convert.ToInt32(drpSubcategory.SelectedValue)) { columnName = Resources.MessageResource.strColumnSubcategoryid.ToString(); prev_value = Convert.ToString(ObjChange.Subcategoryid); curnt_value = Convert.ToString(drpSubcategory.SelectedValue); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = columnName; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); } #endregion #region If Changetype value is changed,Insert into ChangeHistoryDiff table if (ObjChange.Changetype != Convert.ToInt32(drpchangetype.SelectedValue)) { columnName = Resources.MessageResource.strColumnChangeType.ToString(); prev_value = Convert.ToString(ObjChange.Changetype); curnt_value = Convert.ToString(drpchangetype.SelectedValue); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = columnName; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); } #endregion #region If Changestatus value is changed,Insert into ChangeHistoryDiff table if (ObjChange.Changetype != Convert.ToInt32(drpStatus.SelectedValue)) { columnName = Resources.MessageResource.strColumnstatusid.ToString(); prev_value = Convert.ToString(ObjChange.Statusid); curnt_value = Convert.ToString(drpStatus.SelectedValue); ObjChangeHistoryDiff.Historyid = historyid; ObjChangeHistoryDiff.Columnname = columnName; ObjChangeHistoryDiff.Current_value = curnt_value; ObjChangeHistoryDiff.Prev_value = prev_value; ObjChangeHistoryDiff.Insert(); } #endregion } #endregion #region Update the completed status #endregion #region update the data in change_mst table ObjChange.Technician = Convert.ToInt32(drpTechnician.SelectedValue); ObjChange.Categoryid = Convert.ToInt32(drpCategory.SelectedValue); ObjChange.Subcategoryid = Convert.ToInt32(drpSubcategory.SelectedValue); ObjChange.Priority = Convert.ToInt32(drpPriority.SelectedValue); ObjChange.Changetype = Convert.ToInt32(drpchangetype.SelectedValue); ObjChange.Statusid = Convert.ToInt32(drpStatus.SelectedValue); ObjChange.Changeid = Convert.ToInt32(Request.QueryString[0]); ObjChange.Active = true; #region If Current status is closed,then Assign Completed time result = String.Compare(StrStatusString, StrStatusCompleted, true); if (result == 0) { BLLCollection<Incident_To_Change> colincidentchnage = new BLLCollection<Incident_To_Change>(); colincidentchnage = Objincidenttochange.Get_All_By_Changeid(changeid); int id = 0; foreach (Incident_To_Change objitoc in colincidentchnage) { id = Convert.ToInt32(objitoc.Incidentid); } IncidentStates objstate = new IncidentStates(); objstate = objstate.Get_By_id(id); Status_mst objincidentstats = new Status_mst(); objincidentstats = objincidentstats.Get_By_id(objstate.Statusid); string currentincidentstatus = objincidentstats.Statusname.ToString(); int comparestatus = String.Compare(currentincidentstatus, Resources.MessageResource.strStatusClose.ToString(), true); if (comparestatus == 0) { ObjChange.Completedtime = DateTime.Now.ToString(); Change_mst Objcurrentchange = new Change_mst(); ChangeStatus_mst Objchangestatus = new ChangeStatus_mst(); Objcurrentchange = Objcurrentchange.Get_By_id(changeid); Objchangestatus = Objchangestatus.Get_By_id(Objcurrentchange.Statusid); string status = Objchangestatus.Statusname.ToString(); int result1 = String.Compare(status, StrStatusCompleted, true); if (result1 == 0) { ObjChange.Completedtime = Objcurrentchange.Completedtime; ObjChange.Update(); } else { ObjChange.Completedtime = DateTime.Now.ToString(); ObjChange.Update(); } } else { string myScript; //myScript = "<script language=javascript>javascript:alert('Please Close All the Attached Incident');</script>"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Javascript:alert('Please Close Alll the attached incident');", "Javascript:alert('Please Close Alll the attached incident');", true); ///'''Page.RegisterClientScriptBlock("MyScript", myScript); } } else { #endregion ObjChange.Update(); } #endregion // #region Update Include Assets in Change value in IncludedAssetinchange //objincludeasset.Delete(changeid); //for (int i = lstassetupdate.Items.Count - 1; i >= 0; i--) //{ // if (lstassetupdate.Items[i].Selected == true) // { // objincludeasset.Assetid = Convert.ToInt32(lstassetupdate.Items[i].Value); // objincludeasset.Changeid = changeid; // objincludeasset.Insert(); // } //} //#endregion Showchangeinfo(); btnUpdate.Visible = false; btnCancel.Visible = false; }
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 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 BindGridForSelectedParameter() { #region Declaration of localvariable and table Variable int filterId; DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); string userName = ""; int varTechnicianId = Convert.ToInt32(drpTechnician.SelectedValue); string varSortParameter = ""; varSortParameter = drpSort.SelectedValue; if (varSortParameter == "0") { varSortParameter = "createdatetime"; } #endregion #region Get Current User and his Role MembershipUser User = Membership.GetUser(); string varUserRole = ""; string varRoleTechnician = ""; if (User != null) { userName = User.UserName.ToString(); string[] arrUserRole = Roles.GetRolesForUser(); varUserRole = arrUserRole[0].ToString(); varRoleTechnician = Resources.MessageResource.strTechnicianRole.ToString(); } #endregion #region Get User object by Calling Function Get_UserLogin_By_UserName() via passing parameter username and organizationid objOrganization = objOrganization.Get_Organization(); objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid); #endregion #region If User Exist if (objUser.Userid != 0) { string fromdate = null; string todate = null; if (ViewState["fromdate"] != null) { fromdate = ViewState["fromdate"].ToString(); } if (ViewState["todate"] != null) { todate = ViewState["todate"].ToString(); } if (fromdate == "") { fromdate = null; } if (todate == "") { todate = null; } #region Declare Local Variables and Collection of Incident_mst Type string Status; BLLCollection<Incident_mst> col = new BLLCollection<Incident_mst>(); int siteid; #endregion #region Get the Siteid and Filter Parameter siteid = Convert.ToInt32(drpSite.SelectedValue); filterId = Convert.ToInt32(drpFilter.SelectedValue); #endregion #region If Role of User is Technician if (varUserRole == varRoleTechnician) { lblTechnician.Visible = false; drpTechnician.Visible = false; #region If Filter Variable is All if (filterId == 0) { col = objIncident.Get_All_By_Siteid_Technicianid(siteid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #region If Filter Variable is Open else if (filterId == 1) { Status = Resources.MessageResource.strStatusOpen.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid_technicianid(siteid, statusid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #region If Filter variable is Onhold else if (filterId == 2) { Status = Resources.MessageResource.strStatusOnHold.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid_technicianid(siteid, statusid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #region If Filter Variable is Close else if (filterId == 3) { Status = Resources.MessageResource.strStatusClose.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid_technicianid(siteid, statusid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #region If filter variable is resolved else if (filterId == 4) { Status = Resources.MessageResource.strStatusResolved.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid_technicianid(siteid, statusid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion } #endregion #region If User Role is other than Technician else { #region If Filter Variable is All if (filterId == 0) { col = objIncident.Get_All_By_Siteid_Createdbyid(siteid, fromdate, todate, varTechnicianId, varSortParameter); } #endregion #region If Filter Variable is Open else if (filterId == 1) { Status = Resources.MessageResource.strStatusOpen.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid(siteid, statusid, fromdate, todate, varTechnicianId, varSortParameter); } #endregion #region If Filter variable is Onhold else if (filterId == 2) { Status = Resources.MessageResource.strStatusOnHold.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid(siteid, statusid, fromdate, todate, varTechnicianId, varSortParameter); } #endregion #region If Filter Variable is Close else if (filterId == 3) { Status = Resources.MessageResource.strStatusClose.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid(siteid, statusid, fromdate, todate, varTechnicianId, varSortParameter); } #endregion #region If filter variable is resolved else if (filterId == 4) { Status = Resources.MessageResource.strStatusResolved.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid(siteid, statusid, fromdate, todate, varTechnicianId, varSortParameter); } #endregion #region If filter variable is UnAssigned else if (filterId == 5) { Status = Resources.MessageResource.strStatusOpen.ToString(); int statusid; statusid = objStatus.Get_By_StatusName(Status); col = objIncident.Get_All_By_Siteid_Statusid_Unassigned(siteid, statusid, fromdate, todate, varSortParameter); } #endregion #region If filter variable is Assigned else if (filterId == 6) { col = objIncident.Get_All_By_Siteid_Assigned(siteid, fromdate, todate, varSortParameter); } #endregion #region Else Condition will call using Filter variable all else { col = objIncident.Get_All_By_Siteid_Createdbyid(siteid, fromdate, todate, varTechnicianId, varSortParameter); } #endregion } #endregion #region Fetch Each object of type Incident_mst from Collection Incident_mst foreach (Incident_mst objInc in col) { #region Create Table row and assign value to it DataRow row; row = dtTable.NewRow(); row["incidentid"] = Convert.ToString(objInc.Incidentid); row["title"] = objInc.Title; row["requesterid"] = Convert.ToString(objInc.Requesterid); row["createdbyid"] = Convert.ToString(objInc.Createdbyid); row["siteid"] = Convert.ToString(objInc.Siteid); row["createdatetime"] = Convert.ToString(objInc.Createdatetime); objIncidentStates = objIncidentStates.Get_By_id(objInc.Incidentid); row["statusid"] = objIncidentStates.Statusid; row["technicianid"] = objIncidentStates.Technicianid; row["priorityid"] = objIncidentStates.Priorityid; dtTable.Rows.Add(row); #endregion } #endregion } #endregion #region Bind Grid from datasource dtTable DataView dvData = new DataView(dtTable); string sortFormat = "{0} {1}"; String sortDirection = "DESC"; if (varSortParameter == "createdatetime") { //varSortParameter = "incidentid"; } if (varSortParameter == "incidentid") { } dvData.Sort = String.Format(sortFormat, varSortParameter, sortDirection); grdvwRequest.DataSource = null; grdvwRequest.DataBind(); grdvwRequest.DataSource = dvData; grdvwRequest.DataBind(); #endregion if (varUserRole == varRoleTechnician) { RoleTechnician(); } }
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); } } }
public int Update_IncidentStates_mst_By_id(IncidentStates objIncidentStates) { return (int)ExecuteNonQuery(Sp_IncidentStates_Update, new object[] { objIncidentStates.Technicianid, objIncidentStates.Subcategoryid, objIncidentStates.Statusid, objIncidentStates.Requesttypeid, objIncidentStates.Reqapproval, objIncidentStates.Reopened, objIncidentStates.Priorityid, objIncidentStates.Isescalated, objIncidentStates.Incidentid, objIncidentStates.Impactid, objIncidentStates.Hasattachment, objIncidentStates.Closecomments, objIncidentStates.Closeaccepted, objIncidentStates.Categoryid, objIncidentStates.AssignedTime }); }
public object GenerateIncidentStates_mstObject(ref IDataReader returnData) { IncidentStates obj = new IncidentStates(); while (returnData.Read()) { obj.Categoryid = (int)returnData["Categoryid"]; obj.Incidentid = (int)returnData["Incidentid"]; obj.Subcategoryid = (int)returnData["Subcategoryid"]; obj.Technicianid = (int)returnData["Technicianid"]; obj.Statusid = (int)returnData["Statusid"]; obj.Requesttypeid = (int)returnData["Requesttypeid"]; obj.Reqapproval = (bool)returnData["Reqapproval"]; obj.Reopened = (bool)returnData["Reopened"]; obj.Priorityid = (int)returnData["Priorityid"]; obj.Isescalated = (bool)returnData["Isescalated"]; obj.Impactid = (int)returnData["Impactid"]; obj.Hasattachment = (bool)returnData["Hasattachment"]; if (returnData["Closecomments"] != DBNull.Value) { obj.Closecomments = (string)returnData["Closecomments"]; } if (returnData["Closeaccepted"] != DBNull.Value) { obj.Closeaccepted = (string)returnData["Closeaccepted"]; } if (returnData["AssignedTime"] != DBNull.Value) { DateTime Mydatetime = new DateTime(); Mydatetime = (DateTime)returnData["AssignedTime"]; obj.AssignedTime = Mydatetime.ToString(); } } returnData.Close(); returnData.Dispose(); return obj; }
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 Bindgrid() { #region Declaration of localvariable and table Variable int filterId; DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); string userName = ""; int varTechnicianId = 0; string varSortParameter = "createdatetime"; #endregion #region Get Current User and his Role MembershipUser User = Membership.GetUser(); string varUserRole = ""; string varRoleTechnician = ""; if (User != null) { userName = User.UserName.ToString(); string[] arrUserRole = Roles.GetRolesForUser(); varUserRole = arrUserRole[0].ToString(); varRoleTechnician = Resources.MessageResource.strTechnicianRole.ToString(); } #endregion #region Get User object by Calling Function Get_UserLogin_By_UserName() via passing parameter username and organizationid objOrganization = objOrganization.Get_Organization(); objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid); #endregion #region If User Exist if (objUser.Userid != 0) { string fromdate = null; string todate = null; #region Find how many sites have been mapped to current user by calling function Get_All_By_userid() via passing parameter userid int userid = objUser.Userid; colUserToSite = ObjUserToSite.Get_All_By_userid(userid); #endregion #region Fetch each object from Collection of UserToSiteMapping foreach (UserToSiteMapping obj in colUserToSite) { #region Declare Local Variables and Collection of Incident_mst Type string Status; BLLCollection<Incident_mst> col = new BLLCollection<Incident_mst>(); int siteid; #endregion #region Get the Siteid and Filter Parameter siteid = obj.Siteid; filterId = 0; #endregion #region If Role of User is Technician #region If Filter Variable is All if (filterId == 0) { col = objIncident.Get_All_By_Siteid_Requesterid(siteid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #endregion #region Fetch Each object of type Incident_mst from Collection Incident_mst foreach (Incident_mst objInc in col) { #region Create Table row and assign value to it DataRow row; row = dtTable.NewRow(); row["incidentid"] = Convert.ToString(objInc.Incidentid); row["title"] = objInc.Title; row["requesterid"] = Convert.ToString(objInc.Requesterid); row["createdbyid"] = Convert.ToString(objInc.Createdbyid); row["siteid"] = Convert.ToString(objInc.Siteid); row["createdatetime"] = Convert.ToString(objInc.Createdatetime); objIncidentStates = objIncidentStates.Get_By_id(objInc.Incidentid); row["statusid"] = objIncidentStates.Statusid; row["technicianid"] = objIncidentStates.Technicianid; row["priorityid"] = objIncidentStates.Priorityid; dtTable.Rows.Add(row); #endregion } #endregion } #endregion #region Bind Grid from datasource dtTable DataView dvData = new DataView(dtTable); string sortFormat = "{0} {1}"; String sortDirection = "DESC"; if (varSortParameter == "createdatetime") { varSortParameter = "incidentid"; } dvData.Sort = String.Format(sortFormat, varSortParameter, sortDirection); grdvwRequest.DataSource = dvData; grdvwRequest.DataBind(); #endregion } #endregion }
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); 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 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 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 Bindgrid() { #region Declaration of localvariable and table Variable int filterId; DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); string userName = ""; int varTechnicianId = 0; string varSortParameter = "createdatetime"; #endregion #region Get Current User and his Role MembershipUser User = Membership.GetUser(); string varUserRole = ""; string varRoleTechnician = ""; if (User != null) { userName = User.UserName.ToString(); string[] arrUserRole = Roles.GetRolesForUser(); varUserRole = arrUserRole[0].ToString(); varRoleTechnician = Resources.MessageResource.strTechnicianRole.ToString(); } #endregion #region Get User object by Calling Function Get_UserLogin_By_UserName() via passing parameter username and organizationid objOrganization = objOrganization.Get_Organization(); objUser = objUser.Get_UserLogin_By_UserName(userName, objOrganization.Orgid); #endregion #region If User Exist if (objUser.Userid != 0) { string fromdate = null; string todate = null; #region Find how many sites have been mapped to current user by calling function Get_All_By_userid() via passing parameter userid int userid = objUser.Userid; colUserToSite = ObjUserToSite.Get_All_By_userid(userid); #endregion #region Fetch each object from Collection of UserToSiteMapping foreach (UserToSiteMapping obj in colUserToSite) { #region Declare Local Variables and Collection of Incident_mst Type string Status; BLLCollection <Incident_mst> col = new BLLCollection <Incident_mst>(); int siteid; #endregion #region Get the Siteid and Filter Parameter siteid = obj.Siteid; filterId = 0; #endregion #region If Role of User is Technician #region If Filter Variable is All if (filterId == 0) { col = objIncident.Get_All_By_Siteid_Requesterid(siteid, objUser.Userid, fromdate, todate, varSortParameter); } #endregion #endregion #region Fetch Each object of type Incident_mst from Collection Incident_mst foreach (Incident_mst objInc in col) { #region Create Table row and assign value to it DataRow row; row = dtTable.NewRow(); row["incidentid"] = Convert.ToString(objInc.Incidentid); row["title"] = objInc.Title; row["requesterid"] = Convert.ToString(objInc.Requesterid); row["createdbyid"] = Convert.ToString(objInc.Createdbyid); row["siteid"] = Convert.ToString(objInc.Siteid); row["createdatetime"] = Convert.ToString(objInc.Createdatetime); objIncidentStates = objIncidentStates.Get_By_id(objInc.Incidentid); row["statusid"] = objIncidentStates.Statusid; row["technicianid"] = objIncidentStates.Technicianid; row["priorityid"] = objIncidentStates.Priorityid; dtTable.Rows.Add(row); #endregion } #endregion } #endregion #region Bind Grid from datasource dtTable DataView dvData = new DataView(dtTable); string sortFormat = "{0} {1}"; String sortDirection = "DESC"; if (varSortParameter == "createdatetime") { varSortParameter = "incidentid"; } dvData.Sort = String.Format(sortFormat, varSortParameter, sortDirection); grdvwRequest.DataSource = dvData; grdvwRequest.DataBind(); #endregion } #endregion }
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; //} } } }
//#region Handle Button btnAssigned Click Event //protected void btnAssigned_Click(object sender, EventArgs e) //{ // #region Fetch Each Row from GridView,and Check Which Check Box is Selected // foreach (GridViewRow gv in grdvwRequest.Rows) // { // string gvIDs; // #region Declare local variable deleteChkBxItem of Checkbox type to get the Checkbox Instance of Grid Row // CheckBox deleteChkBxItem = (CheckBox)gv.FindControl("deleteRec"); // #endregion // #region If deleteChkBxItem is Checked then ,mapped Current site to this user // if (deleteChkBxItem.Checked) // { // #region Declare local Variables // int incidentid; // int varSiteid; // int oldtechnicianvalue; // #endregion // #region Get the Incident Id from variable of Label type declare in GridView of grdvwSite // gvIDs = ((Label)gv.FindControl("incidentid")).Text.ToString(); // #endregion // #region Convert to incident id into integer // incidentid = Convert.ToInt32(gvIDs); // #endregion // #region If Incident id in Not Null // if (gvIDs != "") // { // Incident_mst objInc = new Incident_mst(); // IncidentStates objIncSta = new IncidentStates(); // objIncSta = objIncSta.Get_By_id(incidentid); // if (objIncSta.Incidentid != 0) // { // oldtechnicianvalue = objIncSta.Technicianid; // int technicianid=Convert.ToInt32(drpTechnician1.SelectedValue); // if(technicianid!=0) // { // int userid = Convert.ToInt32(ViewState["Userid"].ToString()); // #region Update into IncidentStates Table // objIncidentStates.Incidentid = incidentid; // objIncidentStates.Technicianid = technicianid; // objIncidentStates.Subcategoryid = objIncSta.Subcategoryid; // objIncidentStates.Statusid = objIncSta.Statusid; // objIncidentStates.Requesttypeid = objIncSta.Requesttypeid; // objIncidentStates.Priorityid = objIncSta.Priorityid; // objIncidentStates.Categoryid = objIncSta.Categoryid; // objIncidentStates.AssignedTime = objIncSta.AssignedTime; // objIncidentStates.Update(); // #endregion // #region Insert into IncidentHistory Table // objIncidentHistory.Incidentid = incidentid; // objIncidentHistory.Operationownerid = userid; // objIncidentHistory.Operation = "update"; // objIncidentHistory.Insert(); // #endregion // #region Get the Current historyid by calling function Get_Current_IncidentHistoryid() // int historyid = objIncidentHistory.Get_Current_IncidentHistoryid(); // #endregion // #region If technician value is changed,Insert into IncidentHistoryDiff table // #region Declare Local variables // string columnName; // string prev_value; // string curnt_value; // #endregion // #region Get Column Name from MessageResource File // columnName = Resources.MessageResource.strColumnTechnicianid.ToString(); // #endregion // prev_value = Convert.ToString(oldtechnicianvalue); // curnt_value = Convert.ToString(drpTechnician1.SelectedValue); // objIncidentHistoryDiff.Historyid = historyid; // objIncidentHistoryDiff.Columnname = columnName; // objIncidentHistoryDiff.Current_value = curnt_value; // objIncidentHistoryDiff.Prev_value = prev_value; // objIncidentHistoryDiff.Insert(); // if (objIncSta.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 = objIncSta.AssignedTime; // curnt_value = DateTime.Now.ToString(); // objIncidentHistoryDiff.Historyid = historyid; // objIncidentHistoryDiff.Columnname = columnName; // objIncidentHistoryDiff.Current_value = curnt_value; // objIncidentHistoryDiff.Prev_value = prev_value; // objIncidentHistoryDiff.Insert(); // } // #endregion // objInc = objIncident.Get_By_id(incidentid); // if (objInc.Siteid != Convert.ToInt32(drpSite1.SelectedValue)) // { // int oldsiteid = objInc.Siteid; // int oldslaid = objInc.Slaid; // objInc.Siteid = Convert.ToInt32(drpSite1.SelectedValue); // int SLAid = objIncident.Get_By_SLAid(Convert.ToInt32(drpSite1.SelectedValue), objIncSta.Priorityid ); // int requesttypeid = Convert.ToInt32(Resources.MessageResource.strRequestTypeId.ToString()); // if (requesttypeid == Convert.ToInt32(objIncSta.Requesttypeid )) // { // SLAid = 0; // } // objInc.Slaid = SLAid; // objInc.Active = true; // objInc.Update(); // #region If site value is changed,Insert into IncidentHistoryDiff table // columnName = Resources.MessageResource.strColumnSiteid.ToString(); // prev_value = Convert.ToString(oldsiteid); // curnt_value = drpSite1.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 // columnName = Resources.MessageResource.strColumnSLAid.ToString(); // prev_value = Convert.ToString(oldslaid); // curnt_value = Convert.ToString(SLAid); // objIncidentHistoryDiff.Historyid = historyid; // objIncidentHistoryDiff.Columnname = columnName; // objIncidentHistoryDiff.Current_value = curnt_value; // objIncidentHistoryDiff.Prev_value = prev_value; // objIncidentHistoryDiff.Insert(); // #endregion // } // } // } // varSiteid = Convert.ToInt32(drpSite.SelectedValue); // if (varSiteid == 0) // { BindGridForAllParameter(); } // else { BindGridForSelectedParameter(); } // } // #endregion // } // #endregion // } // #endregion //} //#endregion protected void BindSelectedFilter() { string keyword = Session["keyword"].ToString(); string Filterid = Session["Filterid"].ToString(); #region Declaration of localvariable and table Variable DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); #endregion BLLCollection<Incident_mst> col = new BLLCollection<Incident_mst>(); col = objIncident.Get_All_Incidentid_By_SearchParameter(Filterid, keyword); #region Create Table row and assign value to it foreach (Incident_mst obj in col) { IncidentStates objS = new IncidentStates(); DataRow row; row = dtTable.NewRow(); row["incidentid"] = Convert.ToString(obj.Incidentid); row["title"] = obj.Title; row["requesterid"] = Convert.ToString(obj.Requesterid); row["createdbyid"] = Convert.ToString(obj.Createdbyid); row["siteid"] = Convert.ToString(obj.Siteid); row["createdatetime"] = Convert.ToString(obj.Createdatetime); objS = objS.Get_By_id(obj.Incidentid); row["statusid"] = objS.Statusid; row["technicianid"] = objS.Technicianid; row["priorityid"] = objS.Priorityid; dtTable.Rows.Add(row); } #endregion grdvwRequest.DataSource = dtTable; grdvwRequest.DataBind(); Session.Remove("Filterid"); Session.Remove("keyword"); ViewState["keyword"] = keyword; ViewState["Filterid"] = Filterid; }
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; } } }
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"; } } }
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(); }