示例#1
0
 private void BindSeverity()
 {
     try
     {
         clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
         DataSet          dsSeverity          = objClsBLReportIssue.GetSeverity();
         if (dsSeverity.Tables[0].Rows.Count > 0)
         {
             ddlSeverity.DataSource     = dsSeverity.Tables[0];
             ddlSeverity.DataValueField = dsSeverity.Tables[0].Columns[0].ToString();
             ddlSeverity.DataTextField  = dsSeverity.Tables[0].Columns[1].ToString();
             ddlSeverity.DataBind();
         }
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "BindSeverity", ex.StackTrace);
         throw new V2Exceptions();
     }
 }
示例#2
0
        private void BindType()
        {
            try
            {
                ddltype.Items.Clear();

                ddltype.Items.Insert(0, new ListItem("Select", "0"));
                clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
                DataSet          dsType = objClsBLReportIssue.GetType();

                for (int i = 0; i < dsType.Tables[0].Rows.Count; i++)
                {
                    ddltype.Items.Add(new ListItem(dsType.Tables[0].Rows[i]["RequestType"].ToString(), dsType.Tables[0].Rows[i]["TypeID"].ToString()));
                }
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "BindType", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
示例#3
0
        private void BindSubCategory()
        {
            try
            {
                ddlCategories.Items.Clear();
                clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
                DataSet          dsSubCategory       = objClsBLReportIssue.GetSubCategory();

                for (int i = 0; i <= dsSubCategory.Tables[0].Rows.Count - 1; i++)
                {
                    ListItem li = new ListItem(dsSubCategory.Tables[0].Rows[i][1].ToString(), dsSubCategory.Tables[0].Rows[i][0].ToString());
                    //li.Attributes.Add("style","BACKGROUND-COLOR:red");
                    ddlCategories.Items.Add(li);
                    if (ddlCategories.Items[i].Value.Equals("0"))
                    {
                        ddlCategories.Items[i].Attributes.Add("class", "tableheader");
                    }
                    else
                    {
                        ddlCategories.Items[i].Text = ddlCategories.Items[i].Text.Replace("--", "");
                    }


                    //ddlCategories.Items[i].Attributes.Add("BackColor", "red");
                    //   ddlCategories.BackColor=Color.Yellow;
                }

                /*ddlCategories.DataSource = dsSubCategory.Tables[0];
                 * ddlCategories.DataValueField = dsSubCategory.Tables[0].Columns[0].ToString();
                 * ddlCategories.DataTextField = dsSubCategory.Tables[0].Columns[1].ToString();
                 * ddlCategories.DataBind();*/
                /*	for(int i =0;i<=ddlCategories.Items.Count-1;i++)
                 *  {
                 *      ListItem li;
                 *      li = (ListItem)ddlCategories.Items[i];
                 *      li.Attributes.Add("style","background: #333333");
                 *      //ddlCategories.Items.Add(li)	;
                 *  //	ddlCategories.Items[i].Attributes.Add("style","background: yellow");
                 *  }*/
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "BindSubCategory", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
示例#4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            EmployeeID = Convert.ToInt32(Session["UName"]);
            clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
            DataSet          dsEmail             = objClsBLReportIssue.GetEmailID(EmployeeID);

            if (dsEmail.Tables[0].Rows.Count > 0)
            {
                txtEmailID.Text = dsEmail.Tables[0].Rows[0][0].ToString();
                txtName.Text    = dsEmail.Tables[0].Rows[0]["UserName"].ToString();
            }
            if (EmployeeID.ToString() == "" || EmployeeID == 0)
            {
                //Response.Redirect("http://192.168.30.15/intranet/");
                Response.Redirect("http://myv2.v2solutions.com/");
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    try
                    {
                        BindType();
                        BindSeverity();
                        BindSubCategory();
                    }

                    catch (V2Exceptions ex)
                    {
                        throw;
                    }
                    catch (System.Exception ex)
                    {
                        FileLog objFileLog = FileLog.GetLogger();
                        objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "Page_Load", ex.StackTrace);
                        throw new V2Exceptions();
                    }
                    ////	BindPriority();
                }
            }
            btnSubmit.Attributes.Add("onClick", "return validateAndCheck();");
            //lblMessage.Visible = false;
            //btnSubmit.Attributes.Add("onClick","return checkSubCategorySelection();");
        }
示例#5
0
 public string GetCategoryName(clsReportIssue objclsReportIssue)
 {
     try
     {
         clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
         return(objClsBLReportIssue.GetCategoryName(objclsReportIssue));
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "GetCategoryName", ex.StackTrace);
         throw new V2Exceptions();
     }
 }
示例#6
0
        public static string getDropdomdata(string stringParam)
        {
            DataSet dsGetData = new DataSet();
            string  val       = "";

            clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
            clsReportIssue   objClsReportIssue   = new clsReportIssue();
            var categoryissue = stringParam;

            objClsReportIssue.SubCategoryID = Convert.ToInt32(categoryissue);
            dsGetData = objClsBLReportIssue.getCategorySummary(objClsReportIssue);
            if (dsGetData.Tables[0].Rows.Count > 0)
            {
                val = dsGetData.Tables[0].Rows[0]["IssueSummary"].ToString();
            }
            else
            {
                val = "";
            }
            return(val);
        }
示例#7
0
        private void InsertIssueDetails()
        {
            try
            {
                clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
                clsReportIssue   objClsReportIssue   = new clsReportIssue();
                IssueStatus      objIssueStatus      = new IssueStatus();
                intIssueID             = 0;
                objClsReportIssue.Name = txtName.Text.ToString();
                if (objClsReportIssue.Name == "")
                {
                    objClsReportIssue.Name = null;
                }
                objClsReportIssue.EmailID         = txtEmailID.Text.ToString();
                objClsReportIssue.CCEmailID       = txtCCEmailID.Text.ToString();
                objClsReportIssue.PhoneExtension  = txtPhoneExtension.Text.ToString();
                objClsReportIssue.Type            = Convert.ToInt32(ddltype.SelectedItem.Value);
                objClsReportIssue.SeatingLocation = txtSeatingLocation.Text.ToString();
                objClsReportIssue.SubCategoryID   = Convert.ToInt32(ddlCategories.Items[ddlCategories.SelectedIndex].Value);
                objClsReportIssue.SeverityID      = Convert.ToInt32(ddlSeverity.SelectedItem.Value);
                //objClsReportIssue.PriorityID = Convert.ToInt32(ddlPriority.SelectedItem.Value);
                objClsReportIssue.Description = txtDescription.Value.ToString();
                //objClsReportIssue.StatusID = Convert.ToInt32(IssueStatus.New);
                objClsReportIssue.StatusID = 1;
                if ((uploadFiles.PostedFile != null) && (uploadFiles.PostedFile.ContentLength > 0))
                {
                    fn    = System.IO.Path.GetFileNameWithoutExtension(uploadFiles.PostedFile.FileName);
                    fnExt = System.IO.Path.GetExtension(uploadFiles.PostedFile.FileName);
                    objClsReportIssue.UploadedFileName      = fn.ToString();
                    objClsReportIssue.UploadedFileExtension = fnExt.ToString();
                }
                IssueSubmitResult = objClsBLReportIssue.InsertIssueDetails(objClsReportIssue);

                if (IssueSubmitResult.Tables[0].Rows.Count > 0)
                {
                    intIssueID          = Convert.ToInt32(IssueSubmitResult.Tables[0].Rows[0]["IssueId"].ToString());
                    lblMessage.Visible  = true;
                    lblMessage.CssClass = "success";
                    lblMessage.Text     = "Issue Successfully recorded.";
                    ShouldSendMail      = 1;
                    ShouldUploadFile    = 1;
                }
                else
                {
                    lblMessage.Visible  = true;
                    lblMessage.CssClass = "Error";
                    lblMessage.Text     = "Error occured in saving the Issue ,Please try again";
                    ShouldSendMail      = 0;
                    ShouldUploadFile    = 0;
                }


                //if (dsIssueIDAndMemberEmailID.Tables[0].Rows.Count > 0)
                //{
                //    if (dsIssueIDAndMemberEmailID.Tables[0].Rows[0][0].ToString() == "0")
                //    {
                //        lblMessage.Visible = true;
                //        lblMessage.CssClass = "Error";
                //        lblMessage.Text = "This Category is not yet assigned to any of the members of HelpDesk.";
                //        ShouldSendMail = 0;
                //        ShouldUploadFile = 0;
                //    }
                //    else
                //    {
                //        lblMessage.Visible = true;
                //        lblMessage.CssClass = "success";
                //        lblMessage.Text = "Issue Successfully recorded.";
                //        ShouldSendMail = 1;
                //        ShouldUploadFile = 1;
                //        // To get the IssueID and Email ID of the helpdesk member to whom the issue is assigned; and mail is to be sent.
                //        intIssueID = Convert.ToInt32(dsIssueIDAndMemberEmailID.Tables[0].Rows[0]["ReportIssueID"]);
                //        strMemberEmailID = dsIssueIDAndMemberEmailID.Tables[0].Rows[0]["EmployeeEmailID"].ToString();
                //        strAssignedTo = dsIssueIDAndMemberEmailID.Tables[0].Rows[0]["EmployeeName"].ToString();
                //    }
                //}
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "InsertIssueDetails", ex.StackTrace);
                throw new V2Exceptions();
            }
        }
示例#8
0
        private void btnSubmit_Click(object sender, System.EventArgs e)
        {
            try
            {
                clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
                lblMessage.Text      = "";
                lblCcEmailError.Text = "";
                if (txtCCEmailID.Text != "")
                {
                    bool result = objClsBLReportIssue.IsCCEmailExists(txtCCEmailID.Text);

                    if (result == false)
                    {
                        lblCcEmailError.Text = "Please enter valid 'CC to Email' address";
                    }
                    else
                    {
                        InsertIssueDetails();
                        if (ShouldUploadFile == 1)
                        {
                            UploadFiles();
                        }

                        if (ShouldSendMail == 1)
                        {
                            SendMail();
                        }



                        lblMessage.Text      = "Issue Successfully recorded." + "</br>";
                        lblMailError.Visible = true;
                    }
                }
                else
                {
                    InsertIssueDetails();
                    if (ShouldUploadFile == 1)
                    {
                        UploadFiles();
                    }

                    if (ShouldSendMail == 1)
                    {
                        SendMail();
                    }

                    lblMessage.Text      = "Issue Successfully recorded." + "</br>";
                    lblMailError.Visible = true;
                }


                /// <summary>
                /// To send emails to the user, the TL and the HelpDesk Member
                /// </summary>
                ///
            }
            catch (V2Exceptions ex)
            {
                throw;
            }
            catch (System.Exception ex)
            {
                FileLog objFileLog = FileLog.GetLogger();
                objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "btnSubmit_Click", ex.StackTrace);
                throw new V2Exceptions();
            }
        }