private void btnSaveNoPrint_Click(object sender, EventArgs e)
        {
            if (dataGridViewRECEIPT.Rows.Count <= 0)
            {
                MessageBox.Show("لا توجد منتجات للتسجيل");
            }
            else
            {
                textCLIENT_NAME.Text = "new client name";
                textCLIENT_PHONE.Text = "new client phone";
                string r_code = Convert.ToString(DateTime.Now.ToString("yymmdd")) + RandomReceiptCodeString(4);
                rec_info.ADD_RECEIPT_INFO(
                    textCLIENT_NAME.Text, 
                    textCLIENT_PHONE.Text, 
                    Convert.ToDouble(total), 
                    Convert.ToDouble(discount_total), 
                    r_code);

                //dataGridViewsTATISTICS
                for (int i = 0; i < dataGridViewRECEIPT.Rows.Count; i++)
                {
                    rec_items.ADD_RECEIPT_ITEM(
                        Convert.ToString(this.dataGridViewRECEIPT.Rows[i].Cells[1].Value), //pname
                        Convert.ToInt32(this.dataGridViewRECEIPT.Rows[i].Cells[0].Value),  //pid
                        Convert.ToDouble(this.dataGridViewRECEIPT.Rows[i].Cells[3].Value), //pprice
                        Convert.ToInt32(this.dataGridViewRECEIPT.Rows[i].Cells[2].Value), //pcount
                        Convert.ToInt32(this.dataGridViewRECEIPT.Rows[i].Cells[5].Value), //pdiscountcount
                        Convert.ToDouble(this.dataGridViewRECEIPT.Rows[i].Cells[4].Value), //ptotal
                        Convert.ToDouble(this.dataGridViewRECEIPT.Rows[i].Cells[6].Value), //ptotal finall
                        r_code); //receipt_no
                }
                DASHBOARD.getDASHBOARD.dataGridViewRECEIPT.DataSource = rec_info.GET_ALL_RECEIPT_INFO();
                DASHBOARD.getDASHBOARD.dataGridViewsTATISTICS.DataSource = rec_items.GET_SALES_STATISTICS();
                DASHBOARD_WORKER.getDASHBOARD_WORKER.dataGridViewRECEIPT_WORKER.DataSource = rec_info.GET_ALL_RECEIPT_INFO();
                MessageBox.Show(" تم تسجيل الفاتورة ");
                this.Close();
                total = 0;
                discount_total = 0;
                textTOTAL.Text = string.Format("{0}ج", 0);
                txtTotalDisc.Text = string.Empty;
                dataGridViewRECEIPT.Rows.Clear();
                txtTotalDisc.Text = string.Empty;
                textPRO_NAME.Text = string.Empty;
                textBARCODE.Text = string.Empty;
                textITEM_COUNT.Text = string.Empty;
                textITEM_PRICE.Text = string.Empty;
            }
        }
Esempio n. 2
0
        public DASHBOARD()
        {
            if (frm_dash == null)
            {
                frm_dash = this;
            }

            InitializeComponent();
            btnTypeSwitch.Text          = " قطع داخلي";
            labelProdType.Text          = btnTypeSwitch.Text;
            dataGridViewPROD.DataSource = prod.GET_ALL_PRODUCTS(is_item_inner);

            repairDataGridView.DataSource                  = repair.GET_ALL_REPAIRING();
            dataGridViewRECEIPT.DataSource                 = receipt_info.GET_ALL_RECEIPT_INFO();
            dataGridViewClientsAccount.DataSource          = account.GET_ALL_CLIENTS_ACCOUNT(btnChangAccType.Text);
            dataGridViewsTATISTICS.DataSource              = receipt_cls.GET_SALES_STATISTICS();
            dataGridViewRepairStats.DataSource             = repair.GET_REPAIR_STATISTICS();
            dataGridViewProdsStats.DataSource              = prod.GET_PRODUCTS_STATISTICS();
            dataGridViewClients_Acc_CRED_Stats.DataSource  = account.GET_CLIENTS_ACC_CRED_STATISTICS();
            dataGridViewClients_Acc_DEBIT_Stats.DataSource = account.GET_CLIENTS_ACC_DEBIT_STATISTICS();
        }
 private void btnSaveNoPrint_Click(object sender, EventArgs e)
 {
     if (dataGridViewAccountReceipt.Rows.Count <= 0)
     {
         MessageBox.Show("لا توجد منتجات للتسجيل");
     }
     else
     {
         string r_code = Convert.ToString(DateTime.Now.ToString("yymmdd")) + RandomReceiptCodeString(4);
         a_r_info.ADD_ACOUNT_RECEIPT_INFO(
             account_id,
             Convert.ToString(txtClientName.Text),
             Convert.ToDouble(total),
             Convert.ToString(r_code));
         if (txtAcountType.Text == "مدين")
         {
             is_acc_Creditor = true;
         }
         //dataGridViewsTATISTICS
         for (int i = 0; i < dataGridViewAccountReceipt.Rows.Count; i++)
         {
             // string code, string i_name, int prod_id, string item_type, int quant, double price, double tota
             a_r_items.ADD_ACOUNT_RECEIPT_INFO(
                 is_acc_Creditor,
                 r_code,                                                                   //code
                 Convert.ToString(this.dataGridViewAccountReceipt.Rows[i].Cells[1].Value), //i_name
                 Convert.ToInt32(this.dataGridViewAccountReceipt.Rows[i].Cells[0].Value),  //prod_id
                 Convert.ToString(this.dataGridViewAccountReceipt.Rows[i].Cells[2].Value), //item_type
                 Convert.ToInt32(this.dataGridViewAccountReceipt.Rows[i].Cells[3].Value),  //quant
                 Convert.ToDouble(this.dataGridViewAccountReceipt.Rows[i].Cells[4].Value), //price
                 Convert.ToDouble(this.dataGridViewAccountReceipt.Rows[i].Cells[5].Value)  //tota
                 );
         }
         // BL.CLS_CLIENS_ACCOUNT account = new BL.CLS_CLIENS_ACCOUNT();
         DASHBOARD.getDASHBOARD.dataGridViewClientsAccount.DataSource          = account.GET_ALL_CLIENTS_ACCOUNT(DASHBOARD.getDASHBOARD.Is_AccType);
         DASHBOARD.getDASHBOARD.dataGridViewRECEIPT.DataSource                 = rec_info.GET_ALL_RECEIPT_INFO();
         DASHBOARD.getDASHBOARD.dataGridViewsTATISTICS.DataSource              = rec_items.GET_SALES_STATISTICS();
         DASHBOARD.getDASHBOARD.dataGridViewClients_Acc_CRED_Stats.DataSource  = account.GET_CLIENTS_ACC_CRED_STATISTICS();
         DASHBOARD.getDASHBOARD.dataGridViewClients_Acc_DEBIT_Stats.DataSource = account.GET_CLIENTS_ACC_DEBIT_STATISTICS();
         MessageBox.Show(" تم تسجيل الفاتورة ");
         this.Close();
         total         = 0;
         txtTOTAL.Text = string.Format("{0}ج", 0);
         dataGridViewAccountReceipt.Rows.Clear();
     }
 }