protected void btnStatusAdd_Click(object sender, EventArgs e) { statusnamecount = ObjStatus.Get_By_StatusName(txtStatusName.Text.ToString()); if (statusnamecount == 0) { ObjStatus.Description = txtStatusDesc.Text.ToString(); ObjStatus.Statusname = txtStatusName.Text.ToString(); ObjStatus.Insert(); BindGrid(); lblerrmsg.Text = Resources.MessageResource.erradd.ToString(); } else { lblerrmsg.Text = Resources.MessageResource.errStatusExist.ToString(); } txtStatusName.Text = ""; txtStatusDesc.Text = ""; }
public void GetAllCalls() { #region Declaretion of local variables int totalResolutionTimeInMins; int totalSpentMinOnCall; int totalEscalateEmailLevel1Min; int totalEscalateEmailLevel2Min; int totalEscalateEmailLevel3Min; string status = Resources.MessageResource.strStatusOpen.ToString(); int statusId = objStatus.Get_By_StatusName(status); int requesttypeid = Convert.ToInt32(Resources.MessageResource.strRequestTypeIncident.ToString()); #endregion #region Get All Open Calls,of Incident Type colIncident = objIncident.Get_All_For_ProcessEmailEscalate(statusId, requesttypeid); #endregion #region Process Each Call , and check Time spent on call and Escalation Time foreach (Incident_mst obj in colIncident) { #region Get Total Resolution Time Define for Selected SLA totalResolutionTimeInMins = GetResolutionTimeInMins(obj.Slaid); #endregion #region Get Total time Spent on Call,till now totalSpentMinOnCall = obj.Get_TimeSpentonRequest(obj.Incidentid, obj.Siteid, obj.Createdatetime, DateTime.Now.ToString()); #endregion #region Get Total Time Define for Level 1 Escalation to shoot mail totalEscalateEmailLevel1Min = GetLevel1EscalationTimeInMins(obj.Slaid); #endregion #region Check ,If Email Escalation time is defined to shoot mail if (totalEscalateEmailLevel1Min > 0) { #region If Call is not resolved till Email shoot time ,then Sent a mail if ((totalSpentMinOnCall + totalEscalateEmailLevel1Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 1, obj.Slaid); } #endregion } #endregion #region Get Total Time Define for Level 2 Escalation to shoot mail totalEscalateEmailLevel2Min = GetLevel2EscalationTimeInMins(obj.Slaid); #endregion #region Check ,If Email Escalation time is defined to shoot mail if (totalEscalateEmailLevel2Min > 0) { #region If Call is not resolved till Email shoot time ,then Sent a mail if ((totalSpentMinOnCall + totalEscalateEmailLevel2Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 2, obj.Slaid); } #endregion } #endregion #region Get Total Time Define for Level 3 Escalation to shoot mail totalEscalateEmailLevel3Min = GetLevel3EscalationTimeInMins(obj.Slaid); if (totalEscalateEmailLevel3Min > 0) { #region Check ,If Email Escalation time is defined to shoot mail if ((totalSpentMinOnCall + totalEscalateEmailLevel3Min) > totalResolutionTimeInMins) { SendEmail(obj.Incidentid, 3, obj.Slaid); } #endregion } #endregion } #endregion }
protected void BindGridForAllParameter() { #region Declaration of localvariable and table Variable int filterId; DataTable dtTable = new DataTable(); dtTable = CreateDataTable(); string userName = ""; int varTechnicianId = 0; if (drpTechnician.SelectedValue != "") { 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) { ViewState["Userid"] = objUser.Userid; 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; // int siteid; #endregion #region Get the Siteid and Filter Parameter //siteid = obj.Siteid; filterId = Convert.ToInt32(drpFilter.SelectedValue); #endregion #region If Role of User is Technician if (varUserRole == varRoleTechnician) { lblTechnician.Visible = false; drpTechnician.Visible = false; btnCancell.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 = ObjProblem.Get_All_By_Statusid_technicianid(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 = ObjProblem.Get_All_By_Statusid_technicianid(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 = ObjProblem.Get_All_By_Statusid_technicianid(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 = ObjProblem.Get_All_By_Statusid_technicianid(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) { //varSortParameter col = ObjProblem.Get_All_By_Createdbyid(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 = ObjProblem.Get_All_By_Statusid(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 = ObjProblem.Get_All_By_Statusid(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 = ObjProblem.Get_All_By_Statusid(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 = ObjProblem.Get_All_By_Statusid(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 = ObjProblem.Get_All_By_Statusid_Unassigned(statusid, fromdate, todate, varSortParameter); } #endregion #region If filter variable is Assigned else if (filterId == 6) { col = ObjProblem.Get_All_By_Assigned(fromdate, todate, varSortParameter); } #endregion #region Else Condition will call using Filter variable all else { col = ObjProblem.Get_All_By_Createdbyid(fromdate, todate, varTechnicianId, varSortParameter); } #endregion } #endregion } #region Fetch Each object of type Incident_mst from Collection Incident_mst foreach (Problem_mst obj in col) { #region Create Table row and assign value to it DataRow row; row = dtTable.NewRow(); row["ProblemId"] = Convert.ToString(obj.ProblemId); row["title"] = obj.title; row["Requesterid"] = Convert.ToString(obj.Requesterid); row["CreatedByid"] = Convert.ToString(obj.CreatedByid); row["Technicianid"] = Convert.ToString(obj.Technicianid); row["Statusid"] = obj.Statusid; row["Priorityid"] = obj.Priorityid; row["CreateDatetime"] = obj.CreateDatetime; dtTable.Rows.Add(row); #endregion } //} #endregion #region Bind Grid from datasource dtTable grdvwProblem.DataSource = dtTable; grdvwProblem.DataBind(); #endregion #endregion if (varUserRole == varRoleTechnician) { ///RoleTechnician(); } }