Ejemplo n.º 1
0
 public static int addExpensesVoucher(AssetVoucher account)
 {
     try
     {
         int i = AssetVoucherProvider.addExpensesVoucher(account);
         return(i);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 ///
 /// addExpensesVoucher Data Insert table
 /// </summary>
 /// <param name="account"></param>
 /// <returns></returns>
 public static int addExpensesVoucher(AssetVoucher account)
 {
     try
     {
         List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >();
         parameter.Add(new KeyValuePair <string, object>("@voucherExpensesID", account.voucherAssetID)); //1
         parameter.Add(new KeyValuePair <string, object>("@InvoiceNo", account.InvoiceNo));              //2
         parameter.Add(new KeyValuePair <string, object>("@ExpensesDate", account.voucherDate));         //3
         parameter.Add(new KeyValuePair <string, object>("@transactionId", account.transactionId));      //4
         parameter.Add(new KeyValuePair <string, object>("@naveAccountId", account.naveAccountId));      //5
         parameter.Add(new KeyValuePair <string, object>("@jamaAccountId", account.jamaAccountId));      //6
         parameter.Add(new KeyValuePair <string, object>("@IGST", account.IGST));                        //7
         parameter.Add(new KeyValuePair <string, object>("@CGST", account.CGST));                        //8
         parameter.Add(new KeyValuePair <string, object>("@SGST", account.SGST));                        //9
         parameter.Add(new KeyValuePair <string, object>("@IGSTAmt", account.IGSTAmt));                  //10
         parameter.Add(new KeyValuePair <string, object>("@CGSTAmt", account.CGSTAmt));                  //10
         parameter.Add(new KeyValuePair <string, object>("@SGSTAmt", account.SGSTAmt));                  //11
         parameter.Add(new KeyValuePair <string, object>("@crAmount", account.crAmount));                //12
         parameter.Add(new KeyValuePair <string, object>("@drAmount", account.drAmount));                //13
         parameter.Add(new KeyValuePair <string, object>("@GSTRegister", account.GSTRegister));          //14
         parameter.Add(new KeyValuePair <string, object>("@isState", account.isState));                  //15
         parameter.Add(new KeyValuePair <string, object>("@isCash", account.isCash));                    //16
         parameter.Add(new KeyValuePair <string, object>("@PaymentType", account.PaymentType));          //17
         parameter.Add(new KeyValuePair <string, object>("@chqDate", account.chqDate));                  //18
         parameter.Add(new KeyValuePair <string, object>("@chqDDNo", account.chqDDNo));                  //19
         parameter.Add(new KeyValuePair <string, object>("@naration", account.naration));                //20
         parameter.Add(new KeyValuePair <string, object>("@bankId", account.bankId));                    //21
         parameter.Add(new KeyValuePair <string, object>("@bankName", account.bankName));                //21
         parameter.Add(new KeyValuePair <string, object>("@addedBy", 1));                                //22
         parameter.Add(new KeyValuePair <string, object>("@addedOn", DateTime.Now));                     //23
         parameter.Add(new KeyValuePair <string, object>("@isUpdate", account.isUpdate));                //24
         parameter.Add(new KeyValuePair <string, object>("@FinancialYearID", account.FinancialYearID));  //25
         SqlHandler sqlH = new SqlHandler();
         int        i    = sqlH.ExecuteNonQueryI("[dbo].[Usp_addExpensesVoucher]", parameter);
         return(i);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (cmbNaveAccountName.SelectedIndex == 0 || cmbNaveAccountName.SelectedValue == null)
         {
             if (Utility.Langn == "English")
             {
                 MessageBox.Show("Please Select Nave Account Name ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 MessageBox.Show("कृपया नावे  खात्याचे नांव निवडा ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             cmbNaveAccountName.Focus();
             return;
         }
         if (cmbAccountSupGroup.SelectedIndex == 0 || cmbAccountSupGroup.SelectedValue == null)
         {
             if (Utility.Langn == "English")
             {
                 MessageBox.Show("Please Select Account Group SubGroup Type...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 MessageBox.Show("कृपया खाते गट उपप्रकार निवडा ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             cmbAccountSupGroup.Focus();
             return;
         }
         if (cmbJamaAccountName.SelectedIndex == 0 || cmbJamaAccountName.SelectedValue == null)
         {
             if (Utility.Langn == "English")
             {
                 MessageBox.Show("Please select Jama Account Name ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 MessageBox.Show("कृपया  जमा खात्याचे नांव  निवडा ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             cmbJamaAccountName.Focus();
             return;
         }
         if (txtCrAmount.Text.Trim() == string.Empty || txtCrAmount.Text.Trim() == "0")
         {
             if (Utility.Langn == "English")
             {
                 MessageBox.Show("Please Add Nave Amount ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 MessageBox.Show("कृपया नावे  रक्कम भरा ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             txtCrAmount.Focus();
             return;
         }
         if (chbCash.Checked == true)
         {
             if (txtDrAmount.Text.Trim() == string.Empty || txtDrAmount.Text.Trim() == "0")
             {
                 if (Utility.Langn == "English")
                 {
                     MessageBox.Show("Please Add Paid Amount ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 else
                 {
                     MessageBox.Show("कृपया जमा  रक्कम भरा:- ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 }
                 txtDrAmount.Focus();
                 return;
             }
         }
         AssetVoucher asset = new AssetVoucher();
         asset.voucherAssetID  = voucherAssetID1;
         asset.transactionId   = transactionId1;
         asset.FinancialYearID = Utility.FinancilaYearId;
         if (txtInvoice.Text == string.Empty)
         {
             asset.InvoiceNo = "0";
         }
         else
         {
             asset.InvoiceNo = txtInvoice.Text.Trim();
         }
         asset.voucherDate   = dtpDate.Value;
         asset.naveAccountId = Convert.ToInt64(cmbNaveAccountName.SelectedValue);
         asset.jamaAccountId = Convert.ToInt64(cmbJamaAccountName.SelectedValue);
         asset.crAmount      = Convert.ToDecimal(Utility.ParseValue(txtCrAmount.Text));
         if (txtDrAmount.Text == string.Empty)
         {
             asset.drAmount = 0;
         }
         else
         {
             asset.drAmount = Convert.ToDecimal(Utility.ParseValue(txtDrAmount.Text));
         }
         asset.GSTRegister = chbGSTRegister.Checked;
         asset.isState     = cnkState.Checked;
         asset.isCash      = chbCash.Checked;
         if (cmbPaymentType.SelectedIndex == 0)
         {
             asset.bankId = 0;
         }
         else
         {
             asset.bankId = Convert.ToInt32(cmbBank.SelectedValue);
         }
         asset.bankName    = cmbBank.Text.Trim();
         asset.naration    = txtNaration.Text.Trim();
         asset.PaymentType = cmbPaymentType.Text.Trim();
         asset.chqDDNo     = txtchqDDNo.Text.Trim();
         asset.chqDate     = dtpchedate.Value;
         asset.isUpdate    = isUpdate;
         asset.addedBy     = Utility.LoginID;
         if (chbGSTRegister.Checked == true)
         {
             if (txtIGST.SelectedIndex > 0)
             {
                 asset.IGST = Convert.ToDecimal(Utility.ParseValue(txtIGST.Text.Trim()));
                 asset.CGST = Convert.ToDecimal(Utility.ParseValue(txtIGST.Text.Trim())) / 2;
                 asset.SGST = Convert.ToDecimal(Utility.ParseValue(txtIGST.Text.Trim())) / 2;
             }
             else
             {
                 asset.IGST = 0;
                 asset.CGST = 0;
                 asset.SGST = 0;
             }
             if (txtCGSTAmt.Text == string.Empty)
             {
                 txtCGSTAmt.Text = "0";
             }
             if (txtCGSTAmt.Text == string.Empty)
             {
                 txtSGSTAmt.Text = "0";
             }
             asset.CGSTAmt = Convert.ToDecimal(Utility.ParseValue(txtCGSTAmt.Text.Trim()));
             asset.SGSTAmt = Convert.ToDecimal(Utility.ParseValue(txtSGSTAmt.Text.Trim()));
             asset.IGSTAmt = asset.CGSTAmt + asset.SGSTAmt;
         }
         else
         {
             asset.IGST    = 0;
             asset.CGST    = 0;
             asset.SGST    = 0;
             asset.CGSTAmt = 0;
             asset.SGSTAmt = 0;
             asset.IGSTAmt = 0;
         }
         int s = AssetVoucherController.addAssetVoucher(asset);
         if (s > 0)
         {
             if (Utility.Langn == "English")
             {
                 MessageBox.Show("Record Saved Successfully ...!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show("सदर माहिती यशस्वीरित्या साठवले गेले आहे..", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             btnnew_Click(sender, e);
         }
         else
         {
             if (Utility.Langn == "English")
             {
                 MessageBox.Show("Record Does not Saved Successfully ...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
             else
             {
                 MessageBox.Show("सदर माहिती यशस्वीरित्या साठवले गेले नाही आहे ..", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }