Exemplo n.º 1
0
 public virtual CloudAccountDA.PaymentMasterDataTable GetData()
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     CloudAccountDA.PaymentMasterDataTable dataTable = new CloudAccountDA.PaymentMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemplo n.º 2
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int num = 0;

            for (int index = 0; index < this.gvPayment.Rows.Count; ++index)
            {
                CheckBox checkBox = (CheckBox)this.gvPayment.Rows[index].Cells[0].FindControl("chkID");
                if (checkBox.Checked)
                {
                    ++num;
                    this.objPaymentMasterDT = this.objPaymentMasterBll.GetDataByPaymentID(int.Parse(checkBox.ToolTip));
                    if (this.objPaymentMasterDT.Rows.Count > 0)
                    {
                        string s1 = this.objPaymentMasterDT.Rows[0]["InvoiceID"].ToString();
                        string s2 = this.objPaymentMasterDT.Rows[0]["PaymentAmount"].ToString();
                        this.objInvoiceMasterDT = this.objInvoiceMasterBll.GetDataByInvoiceID(int.Parse(s1));
                        if (this.objInvoiceMasterDT.Rows.Count > 0)
                        {
                            this.objInvoiceMasterBll.UpdatePaidToDate(new Decimal?(Decimal.Round(Decimal.Parse(this.objInvoiceMasterDT.Rows[0]["PaidToDate"].ToString()) - Decimal.Parse(s2), 2)), int.Parse(s1));
                        }
                    }
                    this.objPaymentMasterBll.DeletePayment(int.Parse(checkBox.ToolTip));
                }
            }
            if (num == 0)
            {
                this.DisplayAlert("No Payments were selected.");
            }
            else
            {
                this.Response.Redirect("PaymentMaster.aspx");
            }
        }
Exemplo n.º 3
0
 public virtual int Fill(CloudAccountDA.PaymentMasterDataTable dataTable)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
Exemplo n.º 4
0
 private void ViewRecord(string id)
 {
     this.objPaymentMasterDT = this.objPaymentMasterBll.GetDataByPaymentID(int.Parse(id));
     if (this.objPaymentMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.hfPaymentID.Value = this.objPaymentMasterDT.Rows[0]["PaymentID"].ToString();
     this.hfCompanyID.Value = this.objPaymentMasterDT.Rows[0]["CompanyID"].ToString();
     this.hfInvoiceID.Value = this.objPaymentMasterDT.Rows[0]["InvoiceID"].ToString();
 }
Exemplo n.º 5
0
 public virtual CloudAccountDA.PaymentMasterDataTable DeleteByInvoiceID(int?InvoiceID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[2];
     if (InvoiceID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = InvoiceID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.PaymentMasterDataTable dataTable = new CloudAccountDA.PaymentMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemplo n.º 6
0
 public virtual CloudAccountDA.PaymentMasterDataTable GetDataByPaymentID(int?PaymentID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[6];
     if (PaymentID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = PaymentID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.PaymentMasterDataTable dataTable = new CloudAccountDA.PaymentMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemplo n.º 7
0
 public virtual CloudAccountDA.PaymentMasterDataTable GetDataByCompanyStaffID(int?CompanyID, int?StaffID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[4];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (StaffID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = StaffID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     CloudAccountDA.PaymentMasterDataTable dataTable = new CloudAccountDA.PaymentMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemplo n.º 8
0
 private void SetRecord(string id)
 {
     this.objPaymentMasterDT = this.objPaymentMasterBll.GetDataByPaymentID(int.Parse(id));
     if (this.objPaymentMasterDT.Rows.Count <= 0)
     {
         return;
     }
     this.hfPaymentID.Value  = this.objPaymentMasterDT.Rows[0]["PaymentID"].ToString();
     this.hfCompanyID.Value  = this.objPaymentMasterDT.Rows[0]["CompanyID"].ToString();
     this.hfInvoiceID.Value  = this.objPaymentMasterDT.Rows[0]["InvoiceID"].ToString();
     this.objInvoiceMasterDT = this.objInvoiceMasterBll.GetDataByInvoiceID(int.Parse(this.hfInvoiceID.Value));
     if (this.objInvoiceMasterDT.Rows.Count > 0)
     {
         this.hfInvoiceID.Value  = this.objInvoiceMasterDT.Rows[0]["InvoiceID"].ToString();
         this.lblInvoiceAmt.Text = this.objInvoiceMasterDT.Rows[0]["InvoiceTotal"].ToString();
         this.lblInvoiceAmt.Text = Decimal.Round(Decimal.Parse(this.lblInvoiceAmt.Text), 2).ToString();
     }
     this.txtPayment.Text         = this.objPaymentMasterDT.Rows[0]["PaymentAmount"].ToString();
     this.txtPayment.Text         = Decimal.Round(Decimal.Parse(this.txtPayment.Text), 2).ToString();
     this.txtPaymentDate.Text     = DateTime.Parse(this.objPaymentMasterDT.Rows[0]["Date"].ToString()).ToString("MM/dd/yyyy");
     this.txtPaymentNote.Text     = this.objPaymentMasterDT.Rows[0]["Notes"].ToString();
     this.ddlMethod.SelectedIndex = this.ddlMethod.Items.IndexOf(this.ddlMethod.Items.FindByText(this.objPaymentMasterDT.Rows[0]["Method"].ToString()));
 }
Exemplo n.º 9
0
 public virtual int Update(CloudAccountDA.PaymentMasterDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }
Exemplo n.º 10
0
 public virtual CloudAccountDA.PaymentMasterDataTable GetDataByPaymentSearchStaff(int?CompanyID, int?StaffID, string InvoiceNumber, string ClientName, string Notes, string PaymentMethod, DateTime?ToDate, DateTime?FromDate, decimal?AmountTo, decimal?AmountFrom, int?Currency)
 {
     this.Adapter.SelectCommand = this.CommandCollection[8];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (StaffID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = StaffID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     if (InvoiceNumber == null)
     {
         this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[3].Value = InvoiceNumber;
     }
     if (ClientName == null)
     {
         this.Adapter.SelectCommand.Parameters[4].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[4].Value = ClientName;
     }
     if (Notes == null)
     {
         this.Adapter.SelectCommand.Parameters[5].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[5].Value = Notes;
     }
     if (PaymentMethod == null)
     {
         this.Adapter.SelectCommand.Parameters[6].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[6].Value = PaymentMethod;
     }
     if (ToDate.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[7].Value = ToDate.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[7].Value = DBNull.Value;
     }
     if (FromDate.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[8].Value = FromDate.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[8].Value = DBNull.Value;
     }
     if (AmountTo.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[9].Value = AmountTo.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[9].Value = DBNull.Value;
     }
     if (AmountFrom.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[10].Value = AmountFrom.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[10].Value = DBNull.Value;
     }
     if (Currency.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[11].Value = Currency.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[11].Value = DBNull.Value;
     }
     CloudAccountDA.PaymentMasterDataTable dataTable = new CloudAccountDA.PaymentMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemplo n.º 11
0
        private async Task SendMailNew(int paymentID)
        {
            this.objCompanyMasterDT = this.objCompanyMasterBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value));
            string displayName = this.objCompanyMasterDT.Rows[0]["CompanyName"].ToString().ToUpper();
            string addresses   = this.objCompanyMasterDT.Rows[0]["CompanyEmail"].ToString();

            this.objPaymentMasterDT = this.objPaymentMasterBll.GetDataByPaymentID(paymentID);
            string s1 = this.objPaymentMasterDT.Rows[0]["InvoiceID"].ToString();

            this.objInvoiceMasterDT = this.objInvoiceMasterBll.GetDataByInvoiceID(int.Parse(s1));
            string str1 = this.objInvoiceMasterDT.Rows[0]["InvoiceNumber"].ToString();
            string s2   = this.objInvoiceMasterDT.Rows[0]["InvoiceTotal"].ToString();
            //string s3 = this.objInvoiceMasterDT.Rows[0]["PaidToDate"].ToString();
            //Decimal num = Decimal.Parse(s2) - Decimal.Parse(s3);
            Decimal num      = Decimal.Parse(s2);
            string  s4       = this.objInvoiceMasterDT.Rows[0]["ClientID"].ToString();
            string  str2     = string.Empty;
            string  address1 = string.Empty;
            string  str3     = string.Empty;
            string  str4     = string.Empty;
            string  str5     = string.Empty;

            this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByCompanyClientID(int.Parse(s4));
            if (this.objCompanyClientMasterDT.Rows.Count > 0)
            {
                string username = this.objCompanyClientMasterDT.Rows[0]["UserName"].ToString();
                str3     = this.objCompanyClientMasterDT.Rows[0]["OrganizationName"].ToString();
                str4     = this.objCompanyClientMasterDT.Rows[0]["FirstName"].ToString();
                str5     = this.objCompanyClientMasterDT.Rows[0]["LastName"].ToString();
                address1 = this.objCompanyClientMasterDT.Rows[0]["Email"].ToString();
                MembershipUser user = Membership.GetUser(username);
                if (user != null)
                {
                    string key1     = PaymentMaster.GenerateCode();
                    string str6     = HttpUtility.UrlEncode(this.Encrypt(user.UserName, key1));
                    string password = user.GetPassword();
                    string key2     = PaymentMaster.GenerateCode();
                    string str7     = HttpUtility.UrlEncode(this.Encrypt(password, key2));
                    str2 = string.Format("{5}/CheckClient.aspx?page=invoice&anyId={0}&name={1}&tech={2}&keyname={3}&keytech={4}", (object)s1, (object)str6, (object)str7, (object)key1, (object)key2, Common.CommonHandler.WebsiteBaseURL);
                }
            }
            string str8     = string.Empty;
            string str9     = string.Empty;
            string address2 = "*****@*****.**";

            this.objSMTPSettingsDT = this.objSMTPSettingsBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value));
            if (this.objSMTPSettingsDT.Rows.Count > 0)
            {
                str9     = this.objSMTPSettingsDT.Rows[0]["EmailSignature"].ToString();
                address2 = this.objSMTPSettingsDT.Rows[0]["SMTPFrom"].ToString();
            }
            this.objNewPaymentEmailTemplateDT = this.objNewPaymentEmailTemplateBll.GetDataByCompanyID(int.Parse(this.hfCompanyID.Value), "other");
            if (this.objNewPaymentEmailTemplateDT.Rows.Count > 0)
            {
                str8 = this.objNewPaymentEmailTemplateDT.Rows[0]["EmailBody"].ToString();
            }
            Hashtable Variables = new Hashtable()
            {
                {
                    (object)"company",
                    (object)displayName
                },
                {
                    (object)"companyName",
                    (object)displayName
                },
                {
                    (object)"invoiceNum",
                    (object)str1
                },
                {
                    (object)"invoiceNumber",
                    (object)str1
                },
                {
                    (object)"someLink",
                    (object)str2
                },
                {
                    (object)"emailTemplate",
                    (object)str8
                },
                {
                    (object)"companyEmail",
                    (object)("<a href=\"mailto:" + addresses + "\">" + addresses + "</a>")
                },
                {
                    (object)"amountOwned",
                    (object)num
                },
                {
                    (object)"clientOrgName",
                    (object)str3
                },
                {
                    (object)"firstName",
                    (object)str4
                },
                {
                    (object)"lastName",
                    (object)str5
                },
                {
                    (object)"invoiceAmt",
                    (object)s2
                },
                {
                    (object)"directLink",
                    (object)this.directLink
                },
                {
                    (object)"branding",
                    (object)this.branding
                },
                {
                    (object)"emailSign",
                    (object)str9
                },
                {
                    (object)"loginLink",
                    (object)"<a target=\"_blank\" href=\"http://www.billtransact.com/MemberArea.aspx\">https://www.billtransact.com/MemberArea.aspx</a>"
                }
            };
            Parser parser1 = new Parser(this.Server.MapPath("~/MailTemplate/PaymentInformationNew.html"), Variables);
            string path1   = this.Server.MapPath("~\\TempHTMLFiles\\");

            File.WriteAllText(Path.Combine(path1, "Payment.html"), parser1.Parse());
            Parser parser2 = new Parser(path1 + "Payment.html", Variables);

            try
            {
                //MailMessage message = new MailMessage()
                //{
                //  From = new MailAddress(address2, displayName)
                //};
                //message.To.Add(new MailAddress(address1));
                //message.ReplyToList.Add(addresses);
                //message.Subject = displayName + " has received your payment for invoice " + str1 + " in Bill Transact";
                //message.BodyEncoding = Encoding.UTF8;
                //message.Body = parser2.Parse();
                //message.IsBodyHtml = true;

                //Common.CommonHandler.SendSMTPEmail(hfCompanyID.Value, address1, displayName + " has received your payment for invoice " + str1 + " in Bill Transact", parser2.Parse(), true);
                await Common.CommonHandler.SendMail(hfCompanyID.Value, address1, displayName + " has received your payment for invoice " + str1 + " in Bill Transact", parser2.Parse(), true);

                //SmtpClientForCompany.smtpClient(this.hfCompanyID.Value).Send(message);
            }
            catch (Exception ex)
            {
                this.DisplayAlert("Error in sending mail." + (object)ex);
            }
        }