Ejemplo n.º 1
0
        protected void gvServiceDocket_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "D")
                {
                    string serviceBookId = e.CommandArgument.ToString();
                    Entity.Service.CsrJson       csrJson        = new Entity.Service.CsrJson();
                    Business.Service.ServiceBook objServiceBook = new Business.Service.ServiceBook();
                    DataTable dtCsr    = objServiceBook.Service_CsrGetByServiceBookId(Convert.ToInt64(serviceBookId));
                    int       response = objServiceBook.Service_CsrDelete(Convert.ToInt64(dtCsr.Rows[0]["CsrId"].ToString()));

                    if (response > 0)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "mmsg", "alert('Existing csr deleted.');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "mmsg", "alert('Csr can not be deleted!!!....');", true);
                    }
                }
            }
            catch (Exception ex)
            {
                ex.WriteException();
            }
        }
Ejemplo n.º 2
0
        private void Service_CSR_GetByDocketId(string docketNo)
        {
            Business.Service.ServiceBook objServiceBook = new Business.Service.ServiceBook();
            Entity.Service.Csr           csr            = new Entity.Service.Csr();
            DataTable dtServiceBook = objServiceBook.Service_GetServiceBookByDocketNo(docketNo);

            if (dtServiceBook != null && dtServiceBook.Rows.Count > 0)
            {
                Entity.Service.CsrJson csrJson = new Entity.Service.CsrJson();
                DataTable dtCsr = objServiceBook.Service_CsrGetByServiceBookId(Convert.ToInt64(dtServiceBook.Rows[0]["ServiceBookId"].ToString()));
                if (dtCsr != null && dtCsr.Rows.Count > 0)
                {
                    csrJson = JsonConvert.DeserializeObject <Entity.Service.CsrJson>(dtCsr.Rows[0]["CsrContent"].ToString());
                    if (csrJson != null)
                    {
                        lblMachineModel.Text        = csrJson.ProductName;
                        lblMachineId.Text           = csrJson.MachineId;
                        lblDocketNo.Text            = csrJson.DocketNo;
                        lblCustomerID.Text          = csrJson.CustomerCode;
                        lblCustomerNameAddress.Text = csrJson.CustomerName + "<br/>" + csrJson.CustomerAddress;
                        lblMachineSlNo.Text         = csrJson.ProductSerialNo;
                        lblDocketDateTime.Text      = csrJson.DocketDate + " " + csrJson.DocketTime;
                        lblDocketType.Text          = csrJson.DocketType;
                        lblComplaint.Text           = csrJson.Problem;
                        lblDiagonosis.Text          = csrJson.Diagnosis;
                        lblAction.Text            = csrJson.ActionTaken;
                        imgCustomerSign.Src       = (csrJson != null && csrJson.Signature.Length > 0) ? csrJson.Signature : Constants.NoImgaeUrl;
                        imgCustomerStamp.Src      = (csrJson != null && csrJson.Stamp.Length > 0) ? "~/Customer/StampImage/" + csrJson.Stamp : Constants.NoImgaeUrl;
                        lblA3BW.Text              = csrJson.A3BWMeterReading;
                        lblA4BW.Text              = csrJson.A4BWMeterReading;
                        lblA3CL.Text              = csrJson.A3CLMeterReading;
                        lblA4CL.Text              = csrJson.A4CLMeterReading;
                        lblServiceChargeable.Text = csrJson.IsInContract ? string.Empty : "Service Chargeable";

                        if (csrJson.callAttendances != null)
                        {
                            tdRepeatCallCount.RowSpan = csrJson.callAttendances.Count + 1;
                            rptrRepeatCall.DataSource = csrJson.callAttendances;
                            rptrRepeatCall.DataBind();
                        }
                        if (csrJson.sparesUsed != null)
                        {
                            rptrParts.DataSource = csrJson.sparesUsed;
                            rptrParts.DataBind();
                        }
                    }
                }
                else
                {
                    Csr_Save(Request.QueryString["docketno"].ToString());
                    Service_CSR_GetByDocketId(Request.QueryString["docketno"].ToString());
                }
            }
        }