Exemplo n.º 1
0
        protected void updateInvoiceComment(Data.Entities.LeadInvoice invoice, LeadInvoiceDetail invoiceDetail)
        {
            LeadComment comment = null;

            // retrieve comment by reference
            comment = LeadCommentManager.GetLeadCommentByReferenceId(invoiceDetail.InvoiceLineID);

            if (comment == null)
            {
                comment = new LeadComment();
            }

            comment.InsertBy    = Core.SessionHelper.getUserId();
            comment.InsertDate  = DateTime.Now;
            comment.LeadId      = invoice.LeadId;
            comment.PolicyType  = invoice.PolicyTypeID;
            comment.ReferenceID = invoiceDetail.InvoiceLineID;
            comment.Status      = 1;            // active
            comment.UserId      = Core.SessionHelper.getUserId();
            comment.CommentText = string.Format("<div>Invoice # {0} - {1:MM-dd-yyyy} for {2} Qty:{3:N2} Rate:{4:N2} Item Total:{5:N2}</div><div>{6}</div>",
                                                invoice.AdjusterInvoiceNumber,
                                                invoiceDetail.LineDate,
                                                invoiceDetail.LineDescription ?? "",
                                                invoiceDetail.Qty ?? 0,
                                                invoiceDetail.Rate ?? 0,
                                                invoiceDetail.LineAmount ?? 0,
                                                invoiceDetail.Comments ?? ""
                                                );

            LeadCommentManager.Save(comment);
        }
Exemplo n.º 2
0
        static protected void exportClaimLog(LeadPolicy policy)
        {
            int leadID     = (int)policy.LeadId;
            int policyType = (int)policy.PolicyType;

            string policyDescription = policy.LeadPolicyType != null ? policy.LeadPolicyType.Description : "";

            List <LeadComment> policyComments = LeadCommentManager.getLeadCommentByLeadID(leadID, policyType);

            if (policyComments == null || policyComments.Count == 0)
            {
                return;
            }

            // create table 2 cells
            PdfPTable ptable = new PdfPTable(new float[] { 20, 80 });

            ptable.WidthPercentage = 90;


            addPolicyComments(ptable, policyComments, policyDescription);


            doc.Add(ptable);
        }
Exemplo n.º 3
0
        protected void gvComments_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int commentID = 0;
            int leadID    = 0;

            if (e.CommandName == "DoDelete")
            {
                commentID = Convert.ToInt32(e.CommandArgument.ToString());

                try {
                    LeadCommentManager.Delete(commentID);

                    // refresh comments list
                    int.TryParse(Session["LeadIds"].ToString(), out leadID);

                    FillComments(leadID);
                }
                catch (Exception ex) {
                }
            }

            if (e.CommandName == "DoEdit")
            {
                dvEdit.Visible = true;

                commentID = Convert.ToInt32(e.CommandArgument.ToString());

                LeadComment comment = LeadCommentManager.GetLeadCommentById(commentID);

                txtComment.Text = comment.CommentText;

                hfCommentId.Value = commentID.ToString();
            }
        }
Exemplo n.º 4
0
        protected void btnSave_click(object sender, EventArgs e)
        {
            CRM.Data.Entities.LeadComment comment = null;
            string policyType = null;

            if (Page.Request.Params["t"] != null)
            {
                policyType = Page.Request.Params["t"].ToString();

                int policyTypeID = (int)Enum.Parse(typeof(PolicyType), policyType);

                comment = new CRM.Data.Entities.LeadComment();

                comment.CommentText = txtComment.Text.Trim();
                comment.InsertBy    = Convert.ToInt32(Session["UserId"].ToString());
                comment.InsertDate  = DateTime.Now;
                comment.LeadId      = Convert.ToInt32(Session["LeadIds"].ToString());
                comment.PolicyType  = policyTypeID;
                comment.Status      = 1;
                comment.UserId      = comment.InsertBy;

                LeadCommentManager.Save(comment);

                string js = "<script type='text/javascript'>closeRefresh();</script>";

                ScriptManager.RegisterStartupScript(this, typeof(Page), "commentk", js, false);
            }
        }
Exemplo n.º 5
0
        private void bindHistoricalComments()
        {
            int leadID = Core.SessionHelper.getLeadId();

            Data.Entities.LeadPolicy policy = LeadPolicyManager.GetByID(this.policyID);

            if (policy != null && policy.PolicyType != null)
            {
                List <LeadComment> historicalComments = LeadCommentManager.getLeadCommentByLeadID(leadID, (int)policy.PolicyType);

                gvHistoricalComments.DataSource = historicalComments;
                gvHistoricalComments.DataBind();
            }
        }
Exemplo n.º 6
0
        private void FillComments(int LeadId)
        {
            //List<LeadsDocument> lstComment = LeadsUploadManager.getLeadsDocumentByLeadID(LeadId);
            List <LeadComment> lstComment = LeadCommentManager.getLeadCommentByLeadID(LeadId);

            if (lstComment != null && lstComment.Count > 0)
            {
                gvComments.DataSource = lstComment;
                gvComments.DataBind();
            }
            else
            {
                gvComments.DataSource = null;
                gvComments.DataBind();
            }
        }
Exemplo n.º 7
0
        protected void saveComments(string comments, int policyTypeID, int leadID)
        {
            if (!string.IsNullOrEmpty(comments))
            {
                LeadComment comment = new LeadComment();

                comment.LeadId = leadID;

                comment.PolicyType = policyTypeID;

                comment.CommentText = comments;

                comment.UserId = userID;

                comment.InsertDate = DateTime.Now;

                comment.Status = 1;

                LeadCommentManager.Save(comment);
            }
        }
Exemplo n.º 8
0
 protected void deleteInvoiceComment(int invoiceLineID)
 {
     LeadCommentManager.DeleteLeadCommentByReferenceId(invoiceLineID);
 }
Exemplo n.º 9
0
        protected void btnSaveContinue_Click(object sender, EventArgs e)
        {
            lblError.Text      = string.Empty;
            lblError.Visible   = false;
            lblMessage.Text    = string.Empty;
            lblMessage.Visible = false;
            lblSave.Text       = string.Empty;
            lblSave.Visible    = false;
            int commentID = 0;

            try {
                if (int.TryParse(hfCommentId.Value, out commentID) && commentID > 0)
                {
                    LeadComment comment = LeadCommentManager.GetLeadCommentById(commentID);
                    comment.CommentText = txtComment.Text.Trim();
                    comment.UserId      = Convert.ToInt32(Session["UserId"]);

                    LeadComment objld  = LeadCommentManager.Save(comment);
                    int         LeadID = Convert.ToInt32(hfLeadsId.Value);

                    lblSave.Text    = "Comment Saved Successfully";
                    lblSave.Visible = true;
                    txtComment.Text = string.Empty;
                    FillComments(LeadID);
                    dvEdit.Visible        = false;
                    btnNewComment.Visible = true;
                    btnCancelNew.Visible  = true;
                }
                else
                {
                    LeadComment objLeadComment = new LeadComment();
                    int         LeadID         = 0;
                    if (hfLeadsId.Value != null && Convert.ToInt32(hfLeadsId.Value) > 0)
                    {
                        LeadID = Convert.ToInt32(hfLeadsId.Value);
                    }
                    else
                    {
                        lblError.Text    = string.Empty;
                        lblError.Text    = "There is a problem to save.";
                        lblError.Visible = true;
                        return;
                    }
                    objLeadComment.LeadId      = LeadID;
                    objLeadComment.UserId      = Convert.ToInt32(Session["UserId"]);
                    objLeadComment.CommentText = txtComment.Text;
                    objLeadComment.Status      = 1;
                    LeadComment objld = LeadCommentManager.Save(objLeadComment);
                    if (objLeadComment.CommentId > 0)
                    {
                        lblSave.Text    = string.Empty;
                        lblSave.Text    = "Comment Saved Successfully";
                        lblSave.Visible = true;
                        txtComment.Text = string.Empty;
                        FillComments(LeadID);
                        dvEdit.Visible        = false;
                        btnNewComment.Visible = true;
                        btnCancelNew.Visible  = true;
                    }
                }
            }
            catch (Exception ex) {
                lblError.Text    = string.Empty;
                lblError.Text    = "There is a problem to save.";
                lblError.Visible = true;
            }
        }