Пример #1
0
        protected void btSaveComplain_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckTroubleShootingSteps())
                {
                    ScriptManager.RegisterStartupScript(this.UPPanel2, typeof(string), "Alert", "alert('There is something missing in Troubleshooting Step');", true);
                    // Interaction.MsgBox("There is something missing in Troubleshooting Step", MsgBoxStyle.Information, "BSS Administrator");
                    return;
                }

                // DialogResult dgresult = MessageBox.Show("Are you sure to save the record?", "Business Support System", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                //if (dgresult == Windows.Forms.DialogResult.No)
                //{
                // return;
                //}

                if (cmbAssignedDepartment.SelectedValue == "0" | cmbCaseCategory.SelectedValue == "0" | cmbComplainStatus.SelectedValue == "0" | cmbComplaintReportedVia.SelectedValue == "0" | cmbComplainType.SelectedValue == "0" | cmbInitialStatement.SelectedValue == "0" | cmbPOCStatus.SelectedValue == "0")
                {
                    ScriptManager.RegisterStartupScript(this.UPPanel2, typeof(string), "Alert", "alert('Please Select all validate fields');", true);
                    //Interaction.MsgBox("Please Select all validate fields", MsgBoxStyle.Information, "BSS Administrator");
                    return;
                }

                if (tbCallerName.Text == string.Empty | tbCallerNumber.Text == string.Empty | tbLoggedBy.Text == string.Empty | tbPOCName.Text == string.Empty | tbPOCNumber.Text == string.Empty)
                {
                    ScriptManager.RegisterStartupScript(this.UPPanel2, typeof(string), "Alert", "alert('Please Select all validate fields');", true);
                    //Interaction.MsgBox("Please enter all validate fields", MsgBoxStyle.Information, "BSS Administrator");
                    return;
                }

                int      SignupID               = Convert.ToInt16(Session["Complain_SignupID"]);
                int      InitailStatementID     = Convert.ToInt16(cmbInitialStatement.SelectedValue);
                int      ComplaintTypeID        = Convert.ToInt16(cmbComplainType.SelectedValue);
                int      TicketTypeID           = Convert.ToInt16(Session["Complain_TicketTypeID"]);
                int      ComplaintStatusID      = Convert.ToInt16(cmbComplainStatus.SelectedValue);
                int      ProblemDignoseEndID    = 5;
                string   LoggedBy               = tbLoggedBy.Text;
                int      ComplaintReportedviaId = Convert.ToInt16(cmbComplaintReportedVia.SelectedValue);
                DateTime ComplaintReceivedDate  = dtComplainReceived.SelectedDate.Value;
                string   PersonSolving          = string.Empty;
                int      CaseCategoryID         = Convert.ToInt16(cmbCaseCategory.SelectedValue);
                string   CallerName             = tbCallerName.Text;
                string   CallerNumber           = tbCallerNumber.Text;
                string   PoCName          = tbPOCName.Text;
                string   PoCNumber        = tbPOCNumber.Text;
                int      PoCStatusID      = Convert.ToInt16(cmbPOCStatus.SelectedValue);
                int      AssignedToDeptID = Convert.ToInt16(cmbAssignedDepartment.SelectedValue);
                int      AssignedByDeptID = DeptID;
                string   FCR             = string.Empty;
                DateTime Hold_UnHoldTime = Convert.ToDateTime("1/1/1990");
                string   RCA             = string.Empty;
                string   Partner         = string.Empty;
                int      LinkStatusID    = 1;
                string   Location        = "";
                string   Fault           = "";
                string   TxnOwner        = "";
                DateTime ETA             = default(DateTime);
                DateTime ETTR            = default(DateTime);
                string   PersonGivenETA  = null;

                if (ComplaintStatusID == 4)
                {
                    ETA            = dtETA.SelectedDate.Value;
                    ETTR           = dtETTR.SelectedDate.Value;
                    PersonGivenETA = tbPerson.Text;
                }
                else
                {
                    ETA            = Convert.ToDateTime("1/1/1900");
                    ETTR           = Convert.ToDateTime("1/1/1900");
                    PersonGivenETA = "";
                }

                string Remarks            = GetRemarksfromControls();
                string QueryResponse      = "";
                string IPOpsComments      = "";
                string AssignedPersonName = EngineerName;
                int    TransactionBy      = UserID;
                TicketNumber = GetTicketNumber();

                int ComplainID = objBSS.InsertComplain(SignupID, TicketNumber, InitailStatementID, ComplaintTypeID, TicketTypeID, ComplaintStatusID, ProblemDignoseEndID, LoggedBy, ComplaintReportedviaId, ComplaintReceivedDate,
                                                       PersonSolving, CaseCategoryID, CallerName, CallerNumber, PoCName, PoCNumber, PoCStatusID, AssignedToDeptID, AssignedByDeptID, FCR,
                                                       Hold_UnHoldTime, RCA, Partner, LinkStatusID, Location, Fault, TxnOwner, ETA, ETTR, PersonGivenETA,
                                                       Remarks, QueryResponse, IPOpsComments, AssignedPersonName, TransactionBy);

                if (ComplainID > 0)
                {
                    if (InsertComplainTroubleShooting(ComplainID))
                    {
                        btSaveComplain.Visible = false;
                        lblTicketNoAfterComplainGeneration.Text    = "Complained Save with Ticket No " + TicketNumber;
                        lblTicketNoAfterComplainGeneration.Visible = true;
                        //Response.Redirect("~\\SearchCircuits.aspx");
                        //Response.Redirect("~\\SearchCircuits.aspx?TicketNo=" + TicketNumber);
                        //Response.Redirect("~\\ViewFiberDetails.aspx?SignupID=" + Convert.ToInt32(Session["SignupID"]));
                        // Interaction.MsgBox("Complain Insert Sucessfully TicketNo is : " + TicketNumber, MsgBoxStyle.Information, "BSS Administrator");
                    }
                    else
                    {
                        objBSS.ExecQuery("Delete From Ots_Complains Where ComplaintID = " + Convert.ToString(ComplainID));
                        // Interaction.MsgBox("Complain not insert", MsgBoxStyle.Information, "BSS Administrator");
                    }
                }
                else
                {
                    // Interaction.MsgBox("Complain not insert,please Try Again", MsgBoxStyle.Information, "BSS Administrator");
                }
            }
            catch (Exception ex)
            {
                // Interaction.MsgBox("SaveToolStripButton_Click_1:" + ex.Message + "of frmOts_SingleComplain ", MsgBoxStyle.Critical, "BSS Addminstrator");
            }
        }