public DataTable GetPaymentFromCustomerListById(PaymentFromCustomerFormUI PaymentFromCustomerFormUI) { DataTable dtb = new DataTable(); dtb = PaymentFromCustomerFormDAL.GetPaymentFromCustomerListById(PaymentFromCustomerFormUI); return(dtb); }
public int DeletePaymentFromCustomer(PaymentFromCustomerFormUI PaymentFromCustomerFormUI) { int resutl = 0; resutl = PaymentFromCustomerFormDAL.DeletePaymentFromCustomer(PaymentFromCustomerFormUI); return(resutl); }
public int DeletePaymentFromCustomer(PaymentFromCustomerFormUI PaymentFromCustomerFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomer_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_PaymentFromCustomerId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PaymentFromCustomerId"].Value = PaymentFromCustomerFormUI.Tbl_PaymentFromCustomerId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeletePaymentFromCustomer()"; logExcpUIobj.ResourceName = "PaymentFromCustomerFormDAL.CS"; logExcpUIobj.RecordId = PaymentFromCustomerFormUI.Tbl_PaymentFromCustomerId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[PaymentFromCustomerFormDAL : DeletePaymentFromCustomer] An error occured in the processing of Record Id : " + PaymentFromCustomerFormUI.Tbl_PaymentFromCustomerId + ". Details : [" + exp.ToString() + "]"); } return(result); }
protected void Page_Load(object sender, EventArgs e) { PaymentFromCustomerFormUI paymentFromCustomerFormUI = new PaymentFromCustomerFormUI(); if (!Page.IsPostBack) { if (Request.QueryString["PaymentFromCustomerId"] != null) { paymentFromCustomerFormUI.Tbl_PaymentFromCustomerId = Request.QueryString["PaymentFromCustomerId"]; FillForm(paymentFromCustomerFormUI); BindDocumentTypeDropDownList(); btnSave.Visible = false; btnClear.Visible = false; btnUpdate.Visible = true; btnDelete.Visible = true; btnApply.Visible = true; btnDistribution.Visible = true; lblHeading.Text = "Update PaymentFromCustomer"; } else { BindDocumentTypeDropDownList(); btnSave.Visible = true; btnClear.Visible = true; btnUpdate.Visible = false; btnDelete.Visible = false; btnApply.Visible = false; btnDistribution.Visible = false; lblHeading.Text = "Add New PaymentFromCustomer"; } } }
private void FillForm(PaymentFromCustomerFormUI paymentFromCustomerFormUI) { try { DataTable dtb = paymentFromCustomerFormBAL.GetPaymentFromCustomerListById(paymentFromCustomerFormUI); 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]["CustomerName"].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()); } else { lblError.Text = Resources.GlobalResource.msgCouldNotLoadData; divError.Visible = true; } } catch (Exception exp) { logExcpUIobj.MethodName = "FillForm()"; logExcpUIobj.ResourceName = "Finance_Bank_Accounting_Customer_ _Payment_ PaymentFromCustomerForm.CS"; logExcpUIobj.RecordId = paymentFromCustomerFormUI.Tbl_PaymentFromCustomerId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Finance_Bank_Accounting_Payment_From_Customer_PaymentFromCustomerForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]"); } }
public DataTable GetPaymentFromCustomerListById(PaymentFromCustomerFormUI paymentFromCustomerFormUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomer_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_PaymentFromCustomerId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PaymentFromCustomerId"].Value = paymentFromCustomerFormUI.Tbl_PaymentFromCustomerId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "GetPaymentFromCustomerListById()"; logExcpUIobj.ResourceName = "PaymentFromCustomerFormDAL.CS"; logExcpUIobj.RecordId = paymentFromCustomerFormUI.Tbl_PaymentFromCustomerId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[PaymentFromCustomerFormDAL : GetPaymentFromCustomerListById] An error occured in the processing of Record Id : " + paymentFromCustomerFormUI.Tbl_PaymentFromCustomerId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
public int AddPaymentFromCustomer(PaymentFromCustomerFormUI PaymentFromCustomerFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_PaymentFromCustomer_Insert", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar); sqlCmd.Parameters["@CreatedBy"].Value = PaymentFromCustomerFormUI.CreatedBy; sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_OrganizationId"].Value = PaymentFromCustomerFormUI.Tbl_OrganizationId; sqlCmd.Parameters.Add("@ReceiptNumber", SqlDbType.NVarChar); sqlCmd.Parameters["@ReceiptNumber"].Value = PaymentFromCustomerFormUI.ReceiptNumber; sqlCmd.Parameters.Add("@ReceiptDate", SqlDbType.DateTime); sqlCmd.Parameters["@ReceiptDate"].Value = PaymentFromCustomerFormUI.ReceiptDate; sqlCmd.Parameters.Add("@tbl_BatchId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_BatchId"].Value = PaymentFromCustomerFormUI.Tbl_BatchId; sqlCmd.Parameters.Add("@tbl_CustomerId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CustomerId"].Value = PaymentFromCustomerFormUI.Tbl_CustomerId; sqlCmd.Parameters.Add("@tbl_CurrencyId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CurrencyId"].Value = PaymentFromCustomerFormUI.Tbl_CurrencyId; sqlCmd.Parameters.Add("@tbl_PayablesId_Cash", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PayablesId_Cash"].Value = PaymentFromCustomerFormUI.Tbl_PayablesId_Cash; sqlCmd.Parameters.Add("@CashAmount", SqlDbType.Decimal); sqlCmd.Parameters["@CashAmount"].Value = PaymentFromCustomerFormUI.CashAmount; sqlCmd.Parameters.Add("@tbl_PayablesId_Cheque", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PayablesId_Cheque"].Value = PaymentFromCustomerFormUI.Tbl_PayablesId_Cheque; sqlCmd.Parameters.Add("@ChequeAmount", SqlDbType.Decimal); sqlCmd.Parameters["@ChequeAmount"].Value = PaymentFromCustomerFormUI.ChequeAmount; sqlCmd.Parameters.Add("@tbl_PayablesId_CreditCard", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_PayablesId_CreditCard"].Value = PaymentFromCustomerFormUI.Tbl_PayablesId_CreditCard; sqlCmd.Parameters.Add("@CreditCardAmount", SqlDbType.Decimal); sqlCmd.Parameters["@CreditCardAmount"].Value = PaymentFromCustomerFormUI.CreditCardAmount; sqlCmd.Parameters.Add("@DocumentNumber", SqlDbType.NVarChar); sqlCmd.Parameters["@DocumentNumber"].Value = PaymentFromCustomerFormUI.DocumentNumber; sqlCmd.Parameters.Add("@Comments", SqlDbType.NVarChar); sqlCmd.Parameters["@Comments"].Value = PaymentFromCustomerFormUI.Comments; sqlCmd.Parameters.Add("@IsAutoAppliyTo", SqlDbType.Bit); sqlCmd.Parameters["@IsAutoAppliyTo"].Value = PaymentFromCustomerFormUI.IsAutoAppliyTo; sqlCmd.Parameters.Add("@IsPosted", SqlDbType.Bit); sqlCmd.Parameters["@IsPosted"].Value = PaymentFromCustomerFormUI.IsPosted; sqlCmd.Parameters.Add("@PostingDate", SqlDbType.DateTime); sqlCmd.Parameters["@PostingDate"].Value = PaymentFromCustomerFormUI.PostingDate; sqlCmd.Parameters.Add("@ApplyDate", SqlDbType.DateTime); sqlCmd.Parameters["@ApplyDate"].Value = PaymentFromCustomerFormUI.ApplyDate; sqlCmd.Parameters.Add("@tbl_SourceDocumentId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_SourceDocumentId"].Value = PaymentFromCustomerFormUI.Tbl_SourceDocumentId; sqlCmd.Parameters.Add("@opt_DocumentType", SqlDbType.Int); sqlCmd.Parameters["@opt_DocumentType"].Value = PaymentFromCustomerFormUI.opt_DocumentType; sqlCmd.Parameters.Add("@Total", SqlDbType.Decimal); sqlCmd.Parameters["@Total"].Value = PaymentFromCustomerFormUI.opt_DocumentType; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "AddPaymentFromCustomer()"; logExcpUIobj.ResourceName = "PaymentFromCustomerFormDAL.CS"; logExcpUIobj.RecordId = ""; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[PaymentFromCustomerFormDAL : AddPaymentFromCustomer] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } return(result); }