コード例 #1
0
 private void Cancel_Click(object sender, EventArgs e)
 {
     Basic.ClearUIFields(TLPInvoiceDetails);
     BTNAdd.Text    = "Add";
     BTNUpdate.Text = "Update";
     EnableEditUI(false);
 }
コード例 #2
0
 private void PerformAdd( )
 {
     BTNAdd.Text = "Save";
     Basic.ClearUIFields(TLPInvoiceDetails);
     viewModel.AddData();
     CKNewCustomer.Checked = false;
     TXTInvoiceNo.Focus();
 }
コード例 #3
0
        private void ResetForm( )
        {
            Basic.ClearUIFields(TLPInvoiceDetails);
            // DGVSaleItems.Rows.Clear ();
            DataTable dt = (DGVSaleItems.DataSource as BindingSource).DataSource as DataTable;

            dt.Clear();
            BTNAdd.Text    = "Add";
            BTNUpdate.Text = "Update";
            ResetVariables();
        }
コード例 #4
0
 private void PerformSave( )
 {
     if (ValidateFields())
     {
         if (aVM.SaveData(ReadFields()) > 0)
         {
             MessageBox.Show("Your record is save!");
             BTNAdd.Text = "Add";
             Basic.ClearUIFields(TLPAttendence);
         }
     }
 }
コード例 #5
0
 private void Cancel_Click(object sender, EventArgs e)
 {
     if (BTNAdd.Text == "Save")
     {
         BTNAdd.Text = "Add";
     }
     if (BTNUpdate.Text == "Save")
     {
         BTNUpdate.Text = "Update";
     }
     Basic.ClearUIFields(TLPInvoiceDetails);
 }
コード例 #6
0
 private void PerformSave( )
 {
     if (ValidateFields())
     {
         if (eVM.SaveData(ReadFields()) > 0)
         {
             BTNAdd.Text = "Add";
             MessageBox.Show("Your Record got Saved", "Employee");
             LoadEmpCode();
             Basic.ClearUIFields(TLPEmployeeDetails);
         }
         else
         {
             MessageBox.Show("Some error occured while saving data, Kindly recheck and try again", "Employee");
         }
     }
 }
コード例 #7
0
 private void Cancel_Click(object sender, EventArgs e)
 {
     BTNAdd.Text    = "Add";
     BTNUpdate.Text = "Update";
     Basic.ClearUIFields(TLPEmployeeDetails);
 }
コード例 #8
0
        private void AddItemRow( )
        {
            if (vItem != null)
            {
                string    vBarcode  = TXTBarCode.Text;
                string    vQty      = TXTQty.Text;
                string    vAmount   = TXTAmount.Text;
                DataTable dt        = (DGVSaleItems.DataSource as BindingSource).DataSource as DataTable;
                DataRow   nRow      = dt.NewRow();
                double    vAmtd     = double.Parse(vAmount);
                double    vAmtWhole = Math.Round(vAmtd);
                vRoundOffAmt = vAmtWhole - vAmtd;
                double vDiscount = double.Parse(TXTItemDiscount.Text.Trim());
                //ID, InvoiceNo, ItemCode, BarCode, StyleCode,  Qty, Rate, Discount, Tax, Amount
                nRow[0]  = (++ItemID);
                nRow[1]  = CBInvoiceNo.Text;
                nRow[2]  = vItem.ID;
                nRow[3]  = vBarcode;
                nRow[4]  = vItem.StyleCode;
                nRow[5]  = vQty;
                nRow[6]  = vItem.MRP;
                nRow[7]  = vDiscount;
                nRow[8]  = vItem.Tax; //TODO: GST ChangesTax need to update
                nRow[9]  = double.Parse(vAmount);
                nRow[10] = vSMCode;
                dt.Rows.Add(nRow);

                vTotalItems++;
                vTotalQty = vTotalQty + double.Parse(vQty);

                //Total Section
                vTotalRoundOff += vRoundOffAmt;
                vTotalAmount   += vAmtWhole;
                vTotalTax      += vItem.Tax;
                vTotalDiscount += vDiscount;
                vGrandTotal     = vTotalAmount + vTotalTax - vTotalDiscount;
                //Update UI
                TXTGrandTotal.Text = "" + vGrandTotal;
                TXTTaxAmount.Text  = "" + vTotalTax;
                TXTDiscount.Text   = "" + vTotalDiscount;
                TXTSubTotal.Text   = "" + vTotalAmount;
                double gstRate   = 0.00;
                double basicrate = 0.00;
                double gstAmount = 0.00;
                if (vItem.Tax > 0)
                {
                    gstRate = 5.00;
                }
                else
                {       //TODO: make 1000 as readable from GST Table and parameterised and make cosnt vairable while load app
                    if (vItem.MRP <= 1000 || double.Parse(vAmount) <= 1000)
                    {
                        gstRate = 5.00;
                    }
                    else
                    {
                        gstRate = 12.00;
                    }
                }
                basicrate = double.Parse(vAmount) / (1 + (gstRate / 100));
                gstAmount = (basicrate * gstRate / 100) / 2;

                vReciptItems.Add(new ReceiptItemDetails()
                {       //TODO: Need to Implement GST  and Make Int/Double
                    QTY             = vQty,
                    Discount        = "" + vDiscount,
                    MRP             = "" + vItem.MRP,
                    SKU_Description = vItem.Barcode + " / " + vItem.ItemDesc,
                    HSN             = "00000000",
                    GSTAmount       = "" + Math.Round((gstAmount), 2),
                    BasicPrice      = "" + Math.Round(basicrate, 2),
                    GSTPercentage   = "" + Math.Round((gstRate / 2), 2)
                });
                vTotalGST += gstAmount; //TODO: GST Update
                ItemCount++;            //Incrementing InvoiceCount.

                Basic.ClearUIFields(TLPItemDetails);
            }
        }
コード例 #9
0
 private void PerformAdd( )
 {
     BTNAdd.Text = "Save";
     Basic.ClearUIFields(TLPAttendence);
 }
コード例 #10
0
 private void Cancel_Click(object sender, EventArgs e)
 {
     Basic.ClearUIFields(TLPAttendence);
     BTNAdd.Text    = "Add";
     BTNUpdate.Text = "Update";
 }
コード例 #11
0
 private void Cancel_Click(object sender, EventArgs e)
 {
     Basic.ClearUIFields(tlpPersonal);
     BTNAdd.Text    = "Add";
     BTNUpdate.Text = "Update";
 }
コード例 #12
0
 /// <summary>
 /// Clear UI Fields
 /// </summary>
 protected void ClearUiFields( )
 {
     Basic.ClearUIFields(TLPExpenses);
 }