public bool IssueUpdateBySuperAdmin(Model.clsIssueAssignment objIssueAssignment) { try { if (objDLIssueAssignment.IssueUpdateBySuperAdmin(objIssueAssignment)) { return(true); } else { return(false); } } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLIssueAssignment.cs", "IssueUpdateBySuperAdmin", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public bool UpdateIssueByLoginUser(Model.clsIssueAssignment objIssueAssignment, string name1) { try { if (objDLIssueAssignment.UpdateIssueByLoginUser(objIssueAssignment, name1)) { return(true); } else { return(false); } } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLIssueAssignment.cs", "UpdateIssueByLoginUser", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public DataSet ChangeCategoryOfIssue(Model.clsIssueAssignment objIssueAssignment) { SqlParameter[] objParam = new SqlParameter[3]; objParam[0] = new SqlParameter("@ReportIssueID", SqlDbType.Int); objParam[0].Value = objIssueAssignment.ReportIssueID; objParam[1] = new SqlParameter("@SubCategoryID", SqlDbType.Int, 4); objParam[1].Value = objIssueAssignment.SubCategoryID; objParam[2] = new SqlParameter("@StatusID", SqlDbType.Int, 4); objParam[2].Value = objIssueAssignment.StatusID; try { DataSet dsCategory = SqlHelper.ExecuteDataset(sqlConn, CommandType.StoredProcedure, "ChangeCategoryOfIssue", objParam); return(dsCategory); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLIssueAssignment.cs", "ChangeCategoryOfIssue", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public DataSet FileName(Model.clsIssueAssignment objIssueAssignment) { try { return(objDLIssueAssignment.FileName(objIssueAssignment)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsBLIssueAssignment.cs", "FileName", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
private string getUserName(string FromEmailID) { try { objIssueAssignment = new Model.clsIssueAssignment(); objBLIssueAssignment = new BusinessLayer.clsBLIssueAssignment(); objIssueAssignment.IssueAssignmentID = Convert.ToInt32(Session["IssueAssignmentID"]); strgetUserName = objBLIssueAssignment.getUserName(objIssueAssignment); return(strgetUserName); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ViewSelectedIssue.aspx", "getUserName", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
private string getToEmailID() { try { objIssueAssignment = new Model.clsIssueAssignment(); objBLIssueAssignment = new BusinessLayer.clsBLIssueAssignment(); objIssueAssignment.ReportIssueID = Convert.ToInt32(lblIssueID.Text.Trim()); strFromEmailID = objBLIssueAssignment.getToEmailID(objIssueAssignment); return(strFromEmailID); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ViewSelectedIssue.aspx", "getToEmailID", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public DataSet FileName(Model.clsIssueAssignment objIssueAssignment) { try { SqlParameter[] sqlParams = new SqlParameter[1]; sqlParams[0] = new SqlParameter("@ReportIssueID", SqlDbType.Int, 4); sqlParams[0].Value = objIssueAssignment.ReportIssueID; //sqlParams[0].Direction = ParameterDirection.Input; DataSet dsFromEmailID = SqlHelper.ExecuteDataset(sqlConn, CommandType.StoredProcedure, "sp_FileName", sqlParams); return(dsFromEmailID); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLIssueAssignment.cs", "FileName", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public string getUserName(Model.clsIssueAssignment objIssueAssignment) { try { SqlParameter[] sqlParams = new SqlParameter[1]; sqlParams[0] = new SqlParameter("@IssueAssignmentID", SqlDbType.Int, 4); sqlParams[0].Value = objIssueAssignment.IssueAssignmentID; sqlParams[0].Direction = ParameterDirection.Input; string strgetUserName = (SqlHelper.ExecuteScalar(sqlConn, CommandType.StoredProcedure, "sp_GetUserName", sqlParams)).ToString(); return(strgetUserName); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLIssueAssignment.cs", "getUserName", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
private void SendMail() { try { objIssueAssignment = new Model.clsIssueAssignment(); Department = Session["Department"].ToString(); SmtpClient SmtpMail = new SmtpClient(ConfigurationSettings.AppSettings["SMTPServerName"].ToString()); string strDeptEmailID = ConfigurationSettings.AppSettings[Department].ToString(); MailMessage objSendMailToUser = new MailMessage(); string CCCateory = Department + "CC"; strDeptCCEmailID = ConfigurationSettings.AppSettings[CCCateory].ToString(); string FromEmailID = getFromEmailID(); string username = getUserName(FromEmailID); if (Department != "") { //If there is change in status , then mail will triffer with follpwing body & subject. if (Session["status"] != ddlStatus.SelectedValue) { objSendMailToUser.To.Add(new MailAddress(GetIssueRaiserEmailID())); //objSendMailToUser.From = new MailAddress(getFromEmailID()); objSendMailToUser.From = new MailAddress(FromEmailID); objSendMailToUser.Subject = "HelpDesk : Status of Issue " + lblIssueID.Text + " under " + Session["Department"].ToString() + " : " + lblProblemType.Text.ToString() + " has been changed to " + ddlStatus.SelectedItem.Text.ToString() + "."; objSendMailToUser.Body = "Hi, " + "<br>" + "<br>" + "This is to inform you that, the issue status has been changed from " + "<b>" + Session["OldStatus"].ToString() + "</b>" + " to " + "<b>" + ddlStatus.SelectedItem.Text.ToString() + "</b>" + "<br>" + " Issue details are as follows :" + "<br>" + "<br>" + "<b>" + "Issue ID : " + "</b>" + "<b>" + Server.HtmlEncode(lblIssueID.Text.ToString()) + "</b>" + "<br>" + "<br>" + "<b>" + "Department Name : " + "</b>" + Server.HtmlEncode(Session["Department"].ToString()) + "<br>" + "<br>" + "<b>" + "Category Name : " + "</b>" + Server.HtmlEncode(lblProblemType.Text.ToString()) + "<br>" + "<br>" + "<b>" + "Issue Severity : " + "</b>" + Server.HtmlEncode(lblProblemSeverity.Text.ToString()) + "<br>" + "<br>" + "<b>" + "Current Status : " + "</b>" + Server.HtmlEncode(ddlStatus.SelectedItem.Text.ToString()) + "<br>" + "<br>" + "<b>" + "Description : " + "</b>" + Server.HtmlEncode(lblDescription.Text.ToString()) + "." + "<br>" + "<br>" + "<b>" + "Cause : " + "</b>" + Server.HtmlEncode(txtCause.Text.ToString()) + "." + "<br>" + "<br>" + "<b>" + "Fix : " + "</b>" + Server.HtmlEncode(txtFix.Text.ToString()) + "." + "<br>" + "<br>" + "<b>" + "Comment And Description : " + "</b>" + Server.HtmlEncode(txtAddcomment.Text.ToString()) + "." + "<br>" + "<br>" + "Please take the necessary action." + "<br>" + "<br>" + "<br>" + "Regards," + "<br>" + username.ToString(); objSendMailToUser.IsBodyHtml = true; strDeptCCEmailID = strDeptCCEmailID + "," + FromEmailID.ToString(); if (strDeptCCEmailID.Contains(",")) { string[] CCEmailId = strDeptCCEmailID.Split(','); foreach (string email in CCEmailId) { objSendMailToUser.CC.Add(email); } } } // If there is only change in comment, then following mail body will trigger. else { objSendMailToUser.To.Add(new MailAddress(GetIssueRaiserEmailID())); objSendMailToUser.From = new MailAddress(FromEmailID); objSendMailToUser.Subject = "HelpDesk : Issue " + lblIssueID.Text + " under " + Session["Department"].ToString() + " : " + lblProblemType.Text.ToString() + " has a new comment. "; objSendMailToUser.Body = "Hi, " + "<br>" + "<br>" + "This is to inform you that, a new comment has been added. " + "<br>" + " Issue details are as follows :" + "<br>" + "<br>" + "<b>" + "Issue ID : " + "</b>" + "<b>" + Server.HtmlEncode(lblIssueID.Text.ToString()) + "</b>" + "<br>" + "<br>" + "<b>" + "Department Name : " + "</b>" + Server.HtmlEncode(Session["Department"].ToString()) + "<br>" + "<br>" + "<b>" + "Category Name : " + "</b>" + Server.HtmlEncode(lblProblemType.Text.ToString()) + "<br>" + "<br>" + "<b>" + "Issue Severity : " + "</b>" + Server.HtmlEncode(lblProblemSeverity.Text.ToString()) + "<br>" + "<br>" + "<b>" + "Current Status : " + "</b>" + Server.HtmlEncode(ddlStatus.SelectedItem.Text.ToString()) + "<br>" + "<br>" + "<b>" + "Description : " + "</b>" + Server.HtmlEncode(lblDescription.Text.ToString()) + "." + "<br>" + "<br>" + "<b>" + "Cause : " + "</b>" + Server.HtmlEncode(txtCause.Text.ToString()) + "." + "<br>" + "<br>" + "<b>" + "Fix : " + "</b>" + Server.HtmlEncode(txtFix.Text.ToString()) + "." + "<br>" + "<br>" + "<b>" + "Comment And Description : " + "</b>" + Server.HtmlEncode(txtAddcomment.Text.ToString()) + "." + "<br>" + "<br>" + "Please take the necessary action." + "<br>" + "<br>" + "<br>" + "Regards," + "<br>" + username.ToString(); objSendMailToUser.IsBodyHtml = true; strDeptCCEmailID = strDeptCCEmailID + "," + FromEmailID.ToString(); if (strDeptCCEmailID.Contains(",")) { string[] CCEmailId = strDeptCCEmailID.Split(','); foreach (string email in CCEmailId) { objSendMailToUser.CC.Add(email); } } } SmtpMail.UseDefaultCredentials = false; SmtpMail.Credentials = new System.Net.NetworkCredential(ConfigurationSettings.AppSettings["SMTPUserName"].ToString(), ConfigurationSettings.AppSettings["SMTPPassword"].ToString()); SmtpMail.Port = Convert.ToInt32(ConfigurationSettings.AppSettings["PortNumber"].ToString()); SmtpMail.EnableSsl = true; SmtpMail.Send(objSendMailToUser); } Session["UserEmailId"] = ""; Session["Username"] = ""; Session["OldStatus"] = ""; } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ViewSelectedIssue.aspx", "SendMail", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
protected void btnSubmit_Click(object sender, System.EventArgs e) { clsBLViewMyStatus objClsBLViewMyStatus = new clsBLViewMyStatus(); string categoryName = lblProblemType.Text.ToString(); int StatusID; StatusID = Convert.ToInt32(ddlStatus.SelectedValue); if (StatusID != 5) { objIssueAssignment = new Model.clsIssueAssignment(); objBLIssueAssignment = new BusinessLayer.clsBLIssueAssignment(); objIssueAssignment.StatusID = StatusID; objIssueAssignment.IssueAssignmentID = Convert.ToInt32(Session["IssueAssignmentID"]); objIssueAssignment.ReportIssueID = intReportIssueID; objIssueAssignment.Cause = txtCause.Text; objIssueAssignment.Fix = txtFix.Text; if (categoryName == ConfigurationSettings.AppSettings["NewResourceText"].ToString() || categoryName == ConfigurationSettings.AppSettings["UpdateCurrentAllocationText"].ToString() || categoryName == ConfigurationSettings.AppSettings["SingleOrBulkExtensionText"].ToString()) { if (categoryName != ConfigurationSettings.AppSettings["SingleOrBulkExtensionText"].ToString()) { objIssueAssignment.WorkHours = Convert.ToInt32(txtWorkHours.Text); objIssueAssignment.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString()); } objIssueAssignment.NumberOfResources = Convert.ToInt32(txtNoOfResources.Text); objIssueAssignment.ToDate = Convert.ToDateTime(txtEndDate.Text.ToString()); } string name1 = null; if (Convert.ToInt32(Session["SAEmployeeID"]) != 0) { name1 = Session["SAEmployeeID"].ToString(); } else { name1 = Session["EmployeeID"].ToString(); } string name = ""; DataSet dsEmpName = objClsBLViewMyStatus.GetEmployeeName(name1); if (dsEmpName.Tables[0].Rows.Count > 0) { name = dsEmpName.Tables[0].Rows[0]["EmployeeName"].ToString(); } if (txtAddcomment.Text != string.Empty) { objIssueAssignment.AddComment = " [" + DateTime.Now + " ]" + ' ' + name + ':' + ' ' + txtAddcomment.Text + ".</br>"; } else { objIssueAssignment.AddComment = ""; } try { IsRecordUpdated = objBLIssueAssignment.UpdateIssueByLoginUser(objIssueAssignment, name1); lblComment.Text = txtAddcomment.Text; if (IsRecordUpdated) { GetReportIssueHistory(); if (ddlStatus.SelectedItem.Value != "1") { SendMail(); } lblMsg.Text = ""; pnlMessage.Visible = true; } else { lblMsg.Text = "Error while updating issue"; } } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ViewSelectedIssue.aspx", "btnSubmit_Click", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } } else { lblMsg.Visible = true; lblMsg.Text = "Please select 'Inprogress' status"; } }
public bool IssueAssignmentBySuperAdmin(Model.clsIssueAssignment objIssueAssignment) { SqlParameter[] objParam = new SqlParameter[14]; objParam[0] = new SqlParameter("@StatusID", SqlDbType.Int); objParam[0].Value = objIssueAssignment.StatusID; objParam[1] = new SqlParameter("@IssueAssignmentID", SqlDbType.Int); objParam[1].Value = objIssueAssignment.IssueAssignmentID; objParam[2] = new SqlParameter("@ReportIssueID", SqlDbType.Int); objParam[2].Value = objIssueAssignment.ReportIssueID; objParam[3] = new SqlParameter("@Cause", SqlDbType.VarChar, 255); objParam[3].Value = objIssueAssignment.Cause; objParam[4] = new SqlParameter("@Fix", SqlDbType.VarChar, 255); objParam[4].Value = objIssueAssignment.Fix; objParam[5] = new SqlParameter("@EmployeeID", SqlDbType.Int); objParam[5].Value = objIssueAssignment.EmployeeID; objParam[6] = new SqlParameter("@SubCategory", SqlDbType.Int); objParam[6].Value = objIssueAssignment.SubCategory; objParam[7] = new SqlParameter("@TypeID", SqlDbType.Int); objParam[7].Value = objIssueAssignment.TypeID; //Modified by Mahesh F For Issue ID:22449 objParam[8] = new SqlParameter("@ProblemSeverity", SqlDbType.Int); objParam[8].Value = objIssueAssignment.ProblemSeverity; objParam[9] = new SqlParameter("@WorkHours", SqlDbType.Int, 8); objParam[9].Value = objIssueAssignment.WorkHours; objParam[9].Direction = ParameterDirection.Input; objParam[10] = new SqlParameter("@FromDate", SqlDbType.DateTime); if (objIssueAssignment.FromDate.ToString() == "") { objParam[10].Value = null; } else { objParam[10].Value = objIssueAssignment.FromDate; } objParam[10].Direction = ParameterDirection.Input; objParam[11] = new SqlParameter("@ToDate", SqlDbType.DateTime); if (objIssueAssignment.ToDate.ToString() == "") { objParam[11].Value = null; } else { objParam[11].Value = objIssueAssignment.ToDate; } objParam[11].Direction = ParameterDirection.Input; objParam[12] = new SqlParameter("@IssueReportDateTime", SqlDbType.DateTime); if (objIssueAssignment.IssueReportDateTime.ToString() == "") { objParam[12].Value = null; } else { objParam[12].Value = objIssueAssignment.IssueReportDateTime; } objParam[12].Direction = ParameterDirection.Input; objParam[13] = new SqlParameter("@NumberOfResources", SqlDbType.Int, 8); objParam[13].Value = objIssueAssignment.NumberOfResources; objParam[13].Direction = ParameterDirection.Input; int recaffected1; try { recaffected1 = SqlHelper.ExecuteNonQuery(sqlConn, CommandType.StoredProcedure, "sp_IssueAssignmentBySuperAdmin", objParam); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLIssueAssignment.cs", "IssueAssignmentBySuperAdmin", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } return(true); }
public bool UpdateIssueByLoginUser(Model.clsIssueAssignment objIssueAssignment, string name1) { SqlParameter[] objParam = new SqlParameter[11]; objParam[0] = new SqlParameter("@StatusID", SqlDbType.Int); objParam[0].Value = objIssueAssignment.StatusID; objParam[1] = new SqlParameter("@IssueAssignmentID", SqlDbType.Int); objParam[1].Value = objIssueAssignment.IssueAssignmentID; objParam[2] = new SqlParameter("@ReportIssueID", SqlDbType.Int); objParam[2].Value = objIssueAssignment.ReportIssueID; objParam[3] = new SqlParameter("@Cause", SqlDbType.VarChar, 255); objParam[3].Value = objIssueAssignment.Cause; objParam[4] = new SqlParameter("@Fix", SqlDbType.VarChar, 255); objParam[4].Value = objIssueAssignment.Fix; objParam[5] = new SqlParameter("@Comments", SqlDbType.NVarChar, 2000); objParam[5].Value = objIssueAssignment.AddComment; objParam[6] = new SqlParameter("@EmployeeID", SqlDbType.Int); objParam[6].Value = name1; objParam[7] = new SqlParameter("@WorkHours", SqlDbType.Int, 8); objParam[7].Value = objIssueAssignment.WorkHours; objParam[7].Direction = ParameterDirection.Input; objParam[8] = new SqlParameter("@FromDate", SqlDbType.DateTime); if (objIssueAssignment.FromDate.ToString() == "") { objParam[8].Value = null; } else { objParam[8].Value = objIssueAssignment.FromDate; } objParam[8].Direction = ParameterDirection.Input; objParam[9] = new SqlParameter("@ToDate", SqlDbType.DateTime); if (objIssueAssignment.ToDate.ToString() == "") { objParam[9].Value = null; } else { objParam[9].Value = objIssueAssignment.ToDate; } objParam[9].Direction = ParameterDirection.Input; objParam[10] = new SqlParameter("@NumberOfResources", SqlDbType.Int, 8); objParam[10].Value = objIssueAssignment.NumberOfResources; objParam[10].Direction = ParameterDirection.Input; int recaffected1; try { recaffected1 = SqlHelper.ExecuteNonQuery(sqlConn, CommandType.StoredProcedure, "sp_UpdateIssueByLoginUser_New11", objParam); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "clsDLIssueAssignment.cs", "UpdateIssueByLoginUser", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } return(true); }