public int DeleteDownPaymentFromCustomer(DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_DownPaymentFromCustomer_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_DownPaymentFromCustomerId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_DownPaymentFromCustomerId"].Value = downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteDownPaymentFromCustomer()"; logExcpUIobj.ResourceName = "DownPaymentFromCustomerFormDAL.CS"; logExcpUIobj.RecordId = downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[DownPaymentFromCustomerFormDAL : DeleteDownPaymentFromCustomer] An error occured in the processing of Record Id : " + downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId + ". Details : [" + exp.ToString() + "]"); } return(result); }
public int DeleteDownPaymentFromCustomer(DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI) { int resutl = 0; resutl = downPaymentFromCustomerFormDAL.DeleteDownPaymentFromCustomer(downPaymentFromCustomerFormUI); return(resutl); }
public DataTable GetDownPaymentFromCustomerListById(DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI) { DataTable dtb = new DataTable(); dtb = downPaymentFromCustomerFormDAL.GetDownPaymentFromCustomerListById(downPaymentFromCustomerFormUI); return(dtb); }
private void FillForm(DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI) { try { DataTable dtb = downPaymentFromCustomerFormBAL.GetDownPaymentFromCustomerListById(downPaymentFromCustomerFormUI); if (dtb.Rows.Count > 0) { txtReceiptNumber.Text = dtb.Rows[0]["ReceiptNumber"].ToString(); txtReceiptDate.Text = dtb.Rows[0]["ReceiptDate"].ToString(); txtBatchIdGuid.Text = dtb.Rows[0]["tbl_BatchId"].ToString(); txtBatchId.Text = dtb.Rows[0]["BatchName"].ToString(); txtCustomerGuid.Text = dtb.Rows[0]["tbl_CustomerId"].ToString(); txtCustomer.Text = dtb.Rows[0]["tbl_Customer"].ToString(); txtCurrencyGuid.Text = dtb.Rows[0]["tbl_CurrencyId"].ToString(); txtCurrency.Text = dtb.Rows[0]["CurrencyName"].ToString(); txtPayablesCashGuid.Text = dtb.Rows[0]["tbl_PayablesId_Cash"].ToString(); txtPayablesCash.Text = dtb.Rows[0]["PaymentNumberCash"].ToString(); txtCashAmount.Text = dtb.Rows[0]["CashAmount"].ToString(); txtPayablesChequeGuid.Text = dtb.Rows[0]["tbl_PayablesId_Cheque"].ToString(); txtPayablesCheque.Text = dtb.Rows[0]["PaymentNumberCheque"].ToString(); txtPayablesCreditCardGuid.Text = dtb.Rows[0]["tbl_PayablesId_CreditCard"].ToString(); txtPayablesCreditCard.Text = dtb.Rows[0]["PaymentNumberCard"].ToString(); txtChequeAmount.Text = dtb.Rows[0]["ChequeAmount"].ToString(); txtCreditCardAmount.Text = dtb.Rows[0]["CreditCardAmount"].ToString(); txtDocumentNumber.Text = dtb.Rows[0]["DocumentNumber"].ToString(); txtComments.Text = dtb.Rows[0]["Comments"].ToString(); chckIsPosted.Checked = Convert.ToBoolean(dtb.Rows[0]["IsPosted"].ToString()); chckIsAutoApplyTo.Checked = Convert.ToBoolean(dtb.Rows[0]["IsAutoAppliyTo"].ToString()); txtPostingDate.Text = dtb.Rows[0]["PostingDate"].ToString(); txtApplyDate.Text = dtb.Rows[0]["ApplyDate"].ToString(); txtSourceDocumentGuid.Text = dtb.Rows[0]["tbl_SourceDocumentId"].ToString(); txtSourceDocument.Text = dtb.Rows[0]["DocumentNumber"].ToString(); ddlOpt_DocumentType.SelectedIndex = Convert.ToInt32(dtb.Rows[0]["opt_DocumentType"].ToString()); txtTotalAmount.Text = dtb.Rows[0]["TotalAmount"].ToString(); } else { lblError.Text = Resources.GlobalResource.msgCouldNotLoadData; divError.Visible = true; } } catch (Exception exp) { logExcpUIobj.MethodName = "FillForm()"; logExcpUIobj.ResourceName = "Finance_Bank_Accounting_Customer_Down_Payment_DownPaymentFromCustomerForm.CS"; logExcpUIobj.RecordId = downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Finance_Bank_Accounting_Customer_Down_Payment_DownPaymentFromCustomerForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]"); } }
public DataTable GetDownPaymentFromCustomerListById(DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_DownPaymentFromCustomer_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_DownPaymentFromCustomerId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_DownPaymentFromCustomerId"].Value = downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "GetDownPaymentFromCustomerListById()"; logExcpUIobj.ResourceName = "DownPaymentFromCustomerFormDAL.CS"; logExcpUIobj.RecordId = downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[DownPaymentFromCustomerFormDAL : GetDownPaymentFromCustomerListById] An error occured in the processing of Record Id : " + downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
protected void Page_Load(object sender, EventArgs e) { DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI = new DownPaymentFromCustomerFormUI(); if (!Page.IsPostBack) { if (Request.QueryString["DownPaymentFromCustomerId"] != null) { downPaymentFromCustomerFormUI.Tbl_DownPaymentFromCustomerId = Request.QueryString["DownPaymentFromCustomerId"]; FillForm(downPaymentFromCustomerFormUI); BindDocumentTypeDropDownList(); btnSave.Visible = false; btnClear.Visible = false; btnUpdate.Visible = true; btnDelete.Visible = true; btnApply.Visible = true; btnDistribution.Visible = true; lblHeading.Text = "Update DownPaymentFromCustomer"; } else { BindDocumentTypeDropDownList(); btnSave.Visible = true; btnClear.Visible = true; btnUpdate.Visible = false; btnDelete.Visible = false; btnApply.Visible = false; btnDistribution.Visible = false; lblHeading.Text = "Add New DownPaymentFromCustomer"; } } }
public int AddDownPaymentFromCustomer(DownPaymentFromCustomerFormUI downPaymentFromCustomerFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_DownPaymentFromCustomer_Insert", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar); sqlCmd.Parameters["@CreatedBy"].Value = downPaymentFromCustomerFormUI.CreatedBy; sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_OrganizationId"].Value = downPaymentFromCustomerFormUI.Tbl_OrganizationId; sqlCmd.Parameters.Add("@ReceiptNumber", SqlDbType.NVarChar); sqlCmd.Parameters["@ReceiptNumber"].Value = downPaymentFromCustomerFormUI.ReceiptNumber; sqlCmd.Parameters.Add("@ReceiptDate", SqlDbType.DateTime); sqlCmd.Parameters["@ReceiptDate"].Value = downPaymentFromCustomerFormUI.ReceiptDate; sqlCmd.Parameters.Add("@tbl_BatchId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_BatchId"].Value = downPaymentFromCustomerFormUI.Tbl_BatchId; sqlCmd.Parameters.Add("@tbl_CustomerId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CustomerId"].Value = downPaymentFromCustomerFormUI.Tbl_CustomerId; sqlCmd.Parameters.Add("@tbl_CurrencyId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CurrencyId"].Value = downPaymentFromCustomerFormUI.Tbl_CurrencyId; sqlCmd.Parameters.Add("@tbl_PayablesId_Cash", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PayablesId_Cash"].Value = downPaymentFromCustomerFormUI.Tbl_PayablesId_Cash; sqlCmd.Parameters.Add("@CashAmount", SqlDbType.Decimal); sqlCmd.Parameters["@CashAmount"].Value = downPaymentFromCustomerFormUI.CashAmount; sqlCmd.Parameters.Add("@tbl_PayablesId_Cheque", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PayablesId_Cheque"].Value = downPaymentFromCustomerFormUI.Tbl_PayablesId_Cheque; sqlCmd.Parameters.Add("@ChequeAmount", SqlDbType.Decimal); sqlCmd.Parameters["@ChequeAmount"].Value = downPaymentFromCustomerFormUI.ChequeAmount; sqlCmd.Parameters.Add("@tbl_PayablesId_CreditCard", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PayablesId_CreditCard"].Value = downPaymentFromCustomerFormUI.Tbl_PayablesId_CreditCard; sqlCmd.Parameters.Add("@CreditCardAmount", SqlDbType.Decimal); sqlCmd.Parameters["@CreditCardAmount"].Value = downPaymentFromCustomerFormUI.CreditCardAmount; sqlCmd.Parameters.Add("@DocumentNumber", SqlDbType.NVarChar); sqlCmd.Parameters["@DocumentNumber"].Value = downPaymentFromCustomerFormUI.DocumentNumber; sqlCmd.Parameters.Add("@Comments", SqlDbType.NVarChar); sqlCmd.Parameters["@Comments"].Value = downPaymentFromCustomerFormUI.Comments; sqlCmd.Parameters.Add("@IsAutoAppliyTo", SqlDbType.Bit); sqlCmd.Parameters["@IsAutoAppliyTo"].Value = downPaymentFromCustomerFormUI.IsAutoAppliyTo; sqlCmd.Parameters.Add("@IsPosted", SqlDbType.Bit); sqlCmd.Parameters["@IsPosted"].Value = downPaymentFromCustomerFormUI.IsPosted; sqlCmd.Parameters.Add("@PostingDate", SqlDbType.DateTime); sqlCmd.Parameters["@PostingDate"].Value = downPaymentFromCustomerFormUI.PostingDate; sqlCmd.Parameters.Add("@ApplyDate", SqlDbType.DateTime); sqlCmd.Parameters["@ApplyDate"].Value = downPaymentFromCustomerFormUI.ApplyDate; sqlCmd.Parameters.Add("@tbl_SourceDocumentId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_SourceDocumentId"].Value = downPaymentFromCustomerFormUI.Tbl_SourceDocumentId; sqlCmd.Parameters.Add("@opt_DocumentType", SqlDbType.Int); sqlCmd.Parameters["@opt_DocumentType"].Value = downPaymentFromCustomerFormUI.opt_DocumentType; sqlCmd.Parameters.Add("@TotalAmount", SqlDbType.Int); sqlCmd.Parameters["@TotalAmount"].Value = downPaymentFromCustomerFormUI.TotalAmount; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "AddDownPaymentFromCustomer()"; logExcpUIobj.ResourceName = "DownPaymentFromCustomerFormDAL.CS"; logExcpUIobj.RecordId = ""; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[DownPaymentFromCustomerFormDAL : AddDownPaymentFromCustomer] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } return(result); }