Пример #1
0
        public CreditPaymentCashDetails setDetails(System.Data.DataRow dr)
        {
            Data.CreditPaymentCashDetails Details = new Data.CreditPaymentCashDetails();

            Details.BranchDetails       = new Branch(base.Connection, base.Transaction).Details(Int32.Parse(dr["BranchID"].ToString()));
            Details.TerminalNo          = dr["TerminalNo"].ToString();
            Details.SyncID              = Int64.Parse(dr["SyncID"].ToString());
            Details.CreditPaymentCashID = Int64.Parse(dr["CreditPaymentCashID"].ToString());
            Details.TransactionID       = Int64.Parse(dr["TransactionID"].ToString());
            Details.Amount              = decimal.Parse(dr["Amount"].ToString());
            Details.Remarks             = dr["Remarks"].ToString();
            Details.TransactionNo       = dr["TransactionNo"].ToString();

            Details.CreatedOn    = DateTime.Parse(dr["CreatedOn"].ToString());
            Details.LastModified = DateTime.Parse(dr["LastModified"].ToString());

            return(Details);
        }
Пример #2
0
        public CreditPaymentCashDetails setDetails(System.Data.DataRow dr)
        {
            Data.CreditPaymentCashDetails Details = new Data.CreditPaymentCashDetails();

            Details.BranchDetails = new Branch(base.Connection, base.Transaction).Details(Int32.Parse(dr["BranchID"].ToString()));
            Details.TerminalNo = dr["TerminalNo"].ToString();
            Details.SyncID = Int64.Parse(dr["SyncID"].ToString());
            Details.CreditPaymentCashID = Int64.Parse(dr["CreditPaymentCashID"].ToString());
            Details.TransactionID = Int64.Parse(dr["TransactionID"].ToString());
            Details.Amount = decimal.Parse(dr["Amount"].ToString());
            Details.Remarks = dr["Remarks"].ToString();
            Details.TransactionNo = dr["TransactionNo"].ToString();

            Details.CreatedOn = DateTime.Parse(dr["CreatedOn"].ToString());
            Details.LastModified = DateTime.Parse(dr["LastModified"].ToString());

            return Details;
        }
Пример #3
0
        private void LoadData()
        {
            try
            {
                DateTime dteRetValue = DateTime.MinValue;
                Data.CreditPaymentCashDetails clsSearchKeys = new Data.CreditPaymentCashDetails();
                clsSearchKeys.BranchDetails    = new Data.BranchDetails();
                clsSearchKeys.TerminalNo       = "";
                clsSearchKeys.PaymentDateFrom  = DateTime.TryParse(txtTrxStartDate.Text + " 00:00:00", out dteRetValue) ? dteRetValue : DateTime.Now.AddDays(-60);
                clsSearchKeys.PaymentDateTo    = DateTime.TryParse(txtTrxEndDate.Text + " 23:59:59", out dteRetValue) ? dteRetValue : DateTime.Now;
                clsSearchKeys.CreditType       = CreditType.Both;
                clsSearchKeys.CreditCardTypeID = 0;
                clsSearchKeys.ContactID        = mclsCustomerDetails.ContactID;

                Data.Contacts         clsContacts = new Data.Contacts();
                System.Data.DataTable dt          = clsContacts.CreditPaymentCashAsDataTable(clsSearchKeys, "trx.CreatedOn");
                clsContacts.CommitAndDispose();

                System.Data.DataView dv = dt.DefaultView;
                dv.Sort = "TransactionDate";
                dt      = dv.ToTable();

                dgvItems.MultiSelect         = false;
                dgvItems.AutoGenerateColumns = true;
                dgvItems.AutoSize            = false;
                dgvItems.DataSource          = dt.TableName;
                dgvItems.DataSource          = dt;

                foreach (DataGridViewTextBoxColumn dc in dgvItems.Columns)
                {
                    dc.Visible = false;
                }
                dgvItems.Columns["TransactionNo"].Visible   = true;
                dgvItems.Columns["TransactionDate"].Visible = true;
                dgvItems.Columns["CreditReason"].Visible    = true;
                dgvItems.Columns["Amount"].Visible          = true;

                dgvItems.Columns["TransactionNo"].Width   = 150;
                dgvItems.Columns["TransactionDate"].Width = 150;
                if (dt.Rows.Count < 16)
                {
                    dgvItems.Columns["CreditReason"].Width = 350;
                }
                else
                {
                    dgvItems.Columns["CreditReason"].Width = 320;
                }
                int iWidth = (dgvItems.Width - dgvItems.Columns["TransactionNo"].Width - dgvItems.Columns["TransactionDate"].Width - dgvItems.Columns["CreditReason"].Width) / 1;
                if (dt.Rows.Count >= 16)
                {
                    iWidth = iWidth - 20;
                }
                dgvItems.Columns["Amount"].Width = iWidth;

                dgvItems.Columns["TransactionNo"].HeaderText   = "Transaction No";
                dgvItems.Columns["TransactionDate"].HeaderText = "Transaction Date";
                dgvItems.Columns["CreditReason"].HeaderText    = "Description";
                dgvItems.Columns["Amount"].HeaderText          = "Amt. Paid";

                dgvItems.Columns["Amount"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                dgvItems.Columns["Amount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

                dgvItems.Columns["TransactionDate"].DefaultCellStyle.Format = "yyyy-MM-dd hh:mm tt";
                dgvItems.Columns["Amount"].DefaultCellStyle.Format          = "#,##0.#0";

                dgvItems.ReadOnly = true;
                dgvItems.Select();

                decimal decTotalPayable = 0;
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    decimal decTemp = decimal.TryParse(dr["Amount"].ToString(), out decTemp) ? decTemp : 0;
                    decTotalPayable += decTemp;
                }
                lblTotal.Text = decTotalPayable.ToString("#,##0.#0");

                grpBox1.Text = "Payments from: " + clsSearchKeys.PaymentDateFrom.ToString("MMM dd, yyyy") + " to " + clsSearchKeys.PaymentDateTo.ToString("MMM dd, yyyy");

                txtTrxStartDate.SelectAll();
                txtTrxStartDate.Select();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
        public void InsertCreditPaymentCash(Int64 intCreditPaymentID, Int32 intCPRefBranchID, string strCPRefTerminalNo, decimal decAmount, string strRemarks, bool ActivateSuspendedAccount)
        {
            Data.CreditPaymentCashDetails clsCreditPaymentCashDetails = new Data.CreditPaymentCashDetails();
            clsCreditPaymentCashDetails.BranchDetails = mclsTerminalDetails.BranchDetails;
            clsCreditPaymentCashDetails.TerminalNo = mclsTerminalDetails.TerminalNo;
            clsCreditPaymentCashDetails.CreditPaymentID = intCreditPaymentID;
            clsCreditPaymentCashDetails.CPRefBranchID = intCPRefBranchID;
            clsCreditPaymentCashDetails.CPRefTerminalNo = strCPRefTerminalNo;
            clsCreditPaymentCashDetails.TransactionID = mclsSalesTransactionDetails.TransactionID;
            clsCreditPaymentCashDetails.TransactionNo = mclsSalesTransactionDetails.TransactionNo;
            clsCreditPaymentCashDetails.Amount = decAmount;
            clsCreditPaymentCashDetails.Remarks = strRemarks;
            clsCreditPaymentCashDetails.CreatedOn = mclsSalesTransactionDetails.TransactionDate;
            clsCreditPaymentCashDetails.LastModified = mclsSalesTransactionDetails.TransactionDate;
            new Data.CreditPaymentCash(mConnection, mTransaction).Insert(clsCreditPaymentCashDetails);

            new Data.Payment(mConnection, mTransaction).UpdateCredit(intCPRefBranchID, strCPRefTerminalNo, mclsSalesTransactionDetails.CustomerDetails.ContactID, intCreditPaymentID, decAmount, strRemarks, ActivateSuspendedAccount);
        }
Пример #5
0
		private void LoadData()
		{	
			try
			{
                DateTime dteRetValue = DateTime.MinValue;
                Data.CreditPaymentCashDetails clsSearchKeys = new Data.CreditPaymentCashDetails();
                clsSearchKeys.BranchDetails = new Data.BranchDetails();
                clsSearchKeys.TerminalNo = "";
                clsSearchKeys.PaymentDateFrom = DateTime.TryParse(txtTrxStartDate.Text + " 00:00:00", out dteRetValue) ? dteRetValue : DateTime.Now.AddDays(-60);
                clsSearchKeys.PaymentDateTo = DateTime.TryParse(txtTrxEndDate.Text + " 23:59:59", out dteRetValue) ? dteRetValue : DateTime.Now;
                clsSearchKeys.CreditType = CreditType.Both;
                clsSearchKeys.CreditCardTypeID = 0;
                clsSearchKeys.ContactID = mclsCustomerDetails.ContactID;

                Data.Contacts clsContacts = new Data.Contacts();
                System.Data.DataTable dt = clsContacts.CreditPaymentCashAsDataTable(clsSearchKeys, "trx.CreatedOn");
				clsContacts.CommitAndDispose();

                System.Data.DataView dv = dt.DefaultView;
                dv.Sort = "TransactionDate";
                dt = dv.ToTable();

                dgvItems.MultiSelect = false;
                dgvItems.AutoGenerateColumns = true;
                dgvItems.AutoSize = false;
                dgvItems.DataSource = dt.TableName;
                dgvItems.DataSource = dt;

                foreach (DataGridViewTextBoxColumn dc in dgvItems.Columns)
                {
                    dc.Visible = false;
                }
                dgvItems.Columns["TransactionNo"].Visible = true;
                dgvItems.Columns["TransactionDate"].Visible = true;
                dgvItems.Columns["CreditReason"].Visible = true;
                dgvItems.Columns["Amount"].Visible = true;

                dgvItems.Columns["TransactionNo"].Width = 150;
                dgvItems.Columns["TransactionDate"].Width = 150;
                if (dt.Rows.Count < 16) dgvItems.Columns["CreditReason"].Width = 350; else dgvItems.Columns["CreditReason"].Width = 320;
                int iWidth = (dgvItems.Width - dgvItems.Columns["TransactionNo"].Width - dgvItems.Columns["TransactionDate"].Width - dgvItems.Columns["CreditReason"].Width) / 1;
                if (dt.Rows.Count >= 16) iWidth = iWidth - 20;
                dgvItems.Columns["Amount"].Width = iWidth;

                dgvItems.Columns["TransactionNo"].HeaderText = "Transaction No";
                dgvItems.Columns["TransactionDate"].HeaderText = "Transaction Date";
                dgvItems.Columns["CreditReason"].HeaderText = "Description";
                dgvItems.Columns["Amount"].HeaderText = "Amt. Paid";

                dgvItems.Columns["Amount"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                dgvItems.Columns["Amount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

                dgvItems.Columns["TransactionDate"].DefaultCellStyle.Format = "yyyy-MM-dd hh:mm tt";
                dgvItems.Columns["Amount"].DefaultCellStyle.Format = "#,##0.#0";

                dgvItems.ReadOnly = true;
                dgvItems.Select();

                decimal decTotalPayable = 0;
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    decimal decTemp = decimal.TryParse(dr["Amount"].ToString(), out decTemp) ? decTemp : 0;
                    decTotalPayable += decTemp;
                }
                lblTotal.Text = decTotalPayable.ToString("#,##0.#0");

                grpBox1.Text = "Payments from: " + clsSearchKeys.PaymentDateFrom.ToString("MMM dd, yyyy") + " to " + clsSearchKeys.PaymentDateTo.ToString("MMM dd, yyyy");

                txtTrxStartDate.SelectAll();
                txtTrxStartDate.Select();
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message,"RetailPlus",MessageBoxButtons.OK,MessageBoxIcon.Error); 
			}
		}