Exemple #1
0
        protected void bindData()
        {
            int   leadID = SessionHelper.getLeadId();
            Leads lead   = null;

            // get claimant name
            lead = LeadsManager.Get(leadID);
            if (lead != null)
            {
                if (lead.LeadPolicy != null && lead.LeadPolicy.Count > 0)
                {
                    Core.CollectionManager.FillCollection(ddlPolicyType, "policyTypeID", "policyTypeDescription", LeadPolicyTypeManager.GetCurrentPolicy(lead), false);
                }
            }
        }
Exemple #2
0
        protected void autoFillLetter(int leadID)
        {
            Leads lead = null;

            string letterTemplatePath = Server.MapPath(templateURL);

            lead = LeadsManager.Get(leadID);

            if (lead != null)
            {
                string finalDocumentaPath = Server.MapPath(string.Format("~/Temp/Notice_To_Insurer_{0}.doc", lead.LeadId));

                Core.MergeDocumentHelper.autoFillDocument(letterTemplatePath, finalDocumentaPath, lead, true);

                ReportHelper.renderToBrowser(finalDocumentaPath);
            }
        }
Exemple #3
0
        protected void bindData()
        {
            int invoiceID = 0;
            int policyID  = 0;

            CRM.Data.Entities.LeadInvoice invoice        = null;
            List <LeadInvoiceDetail>      invoiceDetails = null;

            // get id for current lead
            int leadID = Core.SessionHelper.getLeadId();

            // get client id
            int clientID = Core.SessionHelper.getClientId();

            // get current policy
            policyID = Core.SessionHelper.getPolicyID();

            // check for new invoice or edit invoice
            ViewState["InvoiceID"] = Request.Params["id"] == null ? "0" : Request.Params["id"].ToString();

            int.TryParse(ViewState["InvoiceID"].ToString(), out invoiceID);

            // get lead/claim
            Leads lead = LeadsManager.Get(leadID);

            if (lead != null)
            {
                bindBillTo(lead);

                lblClient.Text = string.Format("<b>{0} {1}<br/>{2}<br/>{3}<br/>{4}, {5} {6}</b>",
                                               lead.ClaimantFirstName ?? "", //0
                                               lead.ClaimantLastName ?? "",  //1
                                               lead.LossAddress ?? "",       //2
                                               lead.LossAddress2 ?? "",      //3
                                               lead.CityName ?? "",          //4
                                               lead.StateName ?? "",         // 5
                                               lead.Zip ?? ""                //6
                                               );
            }


            if (invoiceID == 0)
            {
                // new invoice
                txtInvoiceDate.Text = DateTime.Now.ToShortDateString();

                invoiceDetails = new List <LeadInvoiceDetail>();
                invoiceDetails.Add(new LeadInvoiceDetail());

                gvInvoiceLines.DataSource = invoiceDetails;

                gvInvoiceLines.DataBind();


                // hide empty row
                gvInvoiceLines.Rows[0].Visible = false;

                // hide print button
                //btnPrint.Visible = false;

                // hiden invoice number
                pnlInvoiceNumber.Visible = false;
            }
            else
            {
                // edit invoice
                invoice = LeadInvoiceManager.Get(invoiceID);

                // show print button
                //btnPrint.Visible = true;

                if (invoice != null && invoice.LeadInvoiceDetail != null)
                {
                    txtInvoiceDate.Text = string.Format("{0:MM/dd/yyyy}", invoice.InvoiceDate);
                    txtDueDate.Text     = string.Format("{0:MM/dd/yyyy}", invoice.DueDate);

                    txtBillTo.Text         = invoice.BillToName;
                    txtBillToAddress1.Text = invoice.BillToAddress1;
                    txtBillToAddress2.Text = invoice.BillToAddress2;
                    txtBillToAddress3.Text = invoice.BillToAddress3;

                    // reference
                    txtReferenceNumber.Text = invoice.AdjusterInvoiceNumber;

                    // show total
                    txtTotalAmount.Text = string.Format("{0:N2}", invoice.TotalAmount);


                    // sort line items by date
                    gvInvoiceLines.DataSource = invoice.LeadInvoiceDetail.OrderBy(x => x.LineDate);

                    gvInvoiceLines.DataBind();

                    // show invoice numebr
                    pnlInvoiceNumber.Visible = true;


                    txtInvoiceNumber.Text = string.Format("{0:N0}", invoice.InvoiceNumber ?? 0);
                }
            }


            bindInvoiceServices();
        }