Example #1
0
        public VEE_Subform(DataGridViewRow Info, string encoder)
        {
            InitializeComponent();
            this.encoder            = encoder;
            VEE_L_User.Text         = encoder;
            erowid                  = Convert.ToInt32(Info.Cells[1].Value.ToString());
            VEE_TB_Row.Text         = erowid.ToString();
            this.VEE_But_Date.Value = DateTime.ParseExact(Info.Cells[0].Value.ToString(), "MM/dd/yyyy", CultureInfo.InvariantCulture);

            BalanseConn VEEConn = new BalanseConn();
            DataTable   branch  = VEEConn.SelectQuery("SELECT BRANCH_NAME FROM BRANCH");
            Dictionary <String, String> test = new Dictionary <string, string>();
            int i = 0;

            foreach (DataRow row in branch.Rows)
            {
                test.Add(i.ToString(), row[0].ToString());
                i++;
            }
            VEE_DD_Branch.DataSource = new BindingSource(test, null);

            VEE_DD_Branch.DisplayMember = "Value";
            VEE_DD_Branch.ValueMember   = "Key";
            //PopulatePODGV();
            PopulateExpensesTab();
        }
Example #2
0
        public void PopulateDepositsTab()
        {
            BalanseConn VEDConn    = new BalanseConn();
            DataTable   VEDSubform = VEDConn.SelectQuery(@"SELECT CASH1, CASH2, CASH3, CASH4, ENC_CHECK1, ENC_CHECK2, ENC_CHECK3, ENC_CHECK4, CHECK1,CHECK2, CHECK3, CHECK4,
                                                        COMMENTS, BRANCH FROM DEPOSITS WHERE ROWID='" + drowid + "'");

            foreach (DataRow row in VEDSubform.Rows)
            {
                VED_TB_Cash1.Text  = row[0].ToString();
                VED_TB_Cash2.Text  = row[1].ToString();
                VED_TB_Cash3.Text  = row[2].ToString();
                VED_TB_Cash4.Text  = row[3].ToString();
                VED_TB_Enc1.Text   = row[4].ToString();
                VED_TB_Enc2.Text   = row[5].ToString();
                VED_TB_Enc3.Text   = row[6].ToString();
                VED_TB_Enc4.Text   = row[7].ToString();
                VED_TB_Ch1.Text    = row[8].ToString();
                VED_TB_Ch2.Text    = row[9].ToString();
                VED_TB_Ch3.Text    = row[10].ToString();
                VED_TB_Ch4.Text    = row[11].ToString();
                VED_RTB_Comm.Text  = row[12].ToString();
                VED_DD_Branch.Text = row[13].ToString();
                UpdateDepositsTotals();
            }
        }
Example #3
0
        public void PopulateSalesTab()
        {
            BalanseConn VESConn    = new BalanseConn();
            DataTable   VESSubform = VESConn.SelectQuery(@"SELECT TOTAL_SALES, CASH, CREDIT_CARD1, CREDIT_CARD2, CREDIT_CARD3, CREDIT_CARD4, CREDIT_CARD5,
                                                         CREDIT_CARD6, CREDIT_CARD7, CREDIT_CARD8, CREDIT_CARD9, CREDIT_CARD10, GOV_CHECK, PER_CHECK,
                                                         GIFT_CHECK, COUPON, TAX_CERT, PO, COMMENTS, BRANCH FROM SALES WHERE ROWID='" + srowid + "'");

            foreach (DataRow row in VESSubform.Rows)
            {
                VES_TB_Total.Text   = row[0].ToString();
                VES_TB_Cash.Text    = row[1].ToString();
                VES_TB_CC1.Text     = row[2].ToString();
                VES_TB_CC2.Text     = row[3].ToString();
                VES_TB_CC3.Text     = row[4].ToString();
                VES_TB_CC4.Text     = row[5].ToString();
                VES_TB_CC5.Text     = row[6].ToString();
                VES_TB_CC6.Text     = row[7].ToString();
                VES_TB_CC7.Text     = row[8].ToString();
                VES_TB_CC8.Text     = row[9].ToString();
                VES_TB_CC9.Text     = row[10].ToString();
                VES_TB_CC10.Text    = row[11].ToString();
                VES_TB_GovCh.Text   = row[12].ToString();
                VES_TB_PerCh.Text   = row[13].ToString();
                VES_TB_GC.Text      = row[14].ToString();
                VES_TB_Cou.Text     = row[15].ToString();
                VES_TB_TaxCert.Text = row[16].ToString();
                VES_TB_POTotal.Text = row[17].ToString();
                VES_RTB_Comm.Text   = row[18].ToString();
                VES_DD_Branch.Text  = row[19].ToString();
                UpdateSalesTotals();
            }
        }
Example #4
0
        public Boolean CheckPayment(int inv_no)
        {
            Boolean     withPayment = true;
            BalanseConn VESConn     = new BalanseConn();
            DataTable   POPayments  = VESConn.SelectQuery("SELECT COUNT(*) FROM PO_PAYMENTS WHERE INVOICE_NO= '" + inv_no + "'");

            if (POPayments.Rows.Count < 1)
            {
                withPayment = false;
            }

            return(withPayment);
        }
Example #5
0
        public void RetrievePayments(int inv_no)
        {
            BalanseConn conn        = new BalanseConn();
            string      QueryString = "SELECT PAYMENT_TYPE, PAID_AMOUNT, PAYMENT_DATE, (CASE DEPOSIT_TAG WHEN 0 THEN 'No' WHEN 1 THEN 'Yes' END) AS DEPOSIT_TAG FROM PO_PAYMENTS WHERE INVOICE_NO =" + inv_no + ";";
            DataTable   dt          = conn.SelectQuery(QueryString);

            foreach (DataRow row in dt.Rows)
            {
                dgv_PoPayments.Rows.Add(
                    row[0].ToString(),
                    Decimal.Parse(row[1].ToString()).ToString("#,##0.00"),
                    DateTime.Parse(row[2].ToString()).ToString("MM/dd/yyyy"),
                    row[3].ToString()
                    );
            }

            RecalculatePaymentTotals();
        }
Example #6
0
        private void label1_Click(object sender, EventArgs e)
        {
            string name = L_TB_Name.Text;
            string pw   = L_TB_Password.Text;


            BalanseConn L_Conn = new BalanseConn();
            DataTable   cred   = L_Conn.SelectQuery("SELECT USER_NAME, PASSWORD FROM USERS WHERE USER_NAME=LOWER('" + name + "') AND PASSWORD=('" + pw + "')");


            if (cred.Rows.Count > 0)
            {
                this.Hide();
                Form_Balanse balanse = new Form_Balanse(name);
                balanse.Show();
            }
            else
            {
                MessageBox.Show("Incorrect User Name and/or Password");
            }
        }
Example #7
0
        public void PopulatePODGV()
        {
            BalanseConn VESConn      = new BalanseConn();
            DataTable   VESSubformPO = VESConn.SelectQuery(@"SELECT ROWID, CUSTOMER_NAME, INVOICE_NO, PO_AMOUNT FROM PURCHASE_ORDERS WHERE SALES_ID= '" + srowid + "'");

            this.VES_DGV_PO.DataSource = null;
            this.VES_DGV_PO.Rows.Clear();

            foreach (DataRow arow in VESSubformPO.Rows)
            {
                string  recid        = arow[0].ToString();
                string  customername = arow[1].ToString();
                int     invoice      = Convert.ToInt32(arow[2].ToString());
                decimal po_amount    = Decimal.Parse(arow[3].ToString());
                VES_DGV_PO.Rows.Add(
                    recid,
                    customername,
                    invoice.ToString(),
                    po_amount.ToString("#,##0.00"));
            }
        }
Example #8
0
        public void PopulateExpensesTab()
        {
            BalanseConn VEEConn    = new BalanseConn();
            DataTable   VEESubform = VEEConn.SelectQuery(@"SELECT PCF_1, PCF_2, PCF_3, PCF_4, WTX, REFUND,  OTH_1, OTH_2, OTH_3, OTH_4,
                                                        COMMENTS, BRANCH FROM EXPENSES WHERE ROWID='" + erowid + "'");

            foreach (DataRow row in VEESubform.Rows)
            {
                VEE_TB_PCF1.Text   = row[0].ToString();
                VEE_TB_PCF2.Text   = row[1].ToString();
                VEE_TB_PCF3.Text   = row[2].ToString();
                VEE_TB_PCF4.Text   = row[3].ToString();
                VEE_TB_WTX.Text    = row[4].ToString();
                VEE_TB_Ref.Text    = row[5].ToString();
                VEE_TB_Oth1.Text   = row[6].ToString();
                VEE_TB_Oth2.Text   = row[7].ToString();
                VEE_TB_Oth3.Text   = row[8].ToString();
                VEE_TB_Oth4.Text   = row[9].ToString();
                VEE_RTB_Comm.Text  = row[10].ToString();
                VEE_DD_Branch.Text = row[11].ToString();
                UpdateExpensesTotals();
            }
        }