public int DeleteDownPaymentToSupplierDistribution(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_DownPaymentToSupplierDistribution_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_DownPaymentToSupplierDistributionId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_DownPaymentToSupplierDistributionId"].Value = downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteDownPaymentToSupplierDistribution()"; logExcpUIobj.ResourceName = "DownPaymentToSupplierDistributionFormDAL.CS"; logExcpUIobj.RecordId = downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[DownPaymentToSupplierDistributionFormDAL : DeleteDownPaymentToSupplierDistribution] An error occured in the processing of Record Id : " + downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId + ". Details : [" + exp.ToString() + "]"); } return(result); }
public int DeleteDownPaymentToSupplierDistribution(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { int resutl = 0; resutl = downPaymentToSupplierDistributionFormDAL.DeleteDownPaymentToSupplierDistribution(downPaymentToSupplierDistributionFormUI); return(resutl); }
public DataTable GetDownPaymentToSupplierDistributionListById(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { DataTable dtb = new DataTable(); dtb = downPaymentToSupplierDistributionFormDAL.GetDownPaymentToSupplierDistributionListById(downPaymentToSupplierDistributionFormUI); return(dtb); }
public DataTable GetDownPaymentToSupplierDistributionListById(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_DownPaymentToSupplierDistribution_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_DownPaymentToSupplierDistributionId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_DownPaymentToSupplierDistributionId"].Value = downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "GetDownPaymentToSupplierDistributionListById()"; logExcpUIobj.ResourceName = "DownPaymentToSupplierDistributionFormDAL.CS"; logExcpUIobj.RecordId = downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[DownPaymentToSupplierDistributionFormDAL : GetDownPaymentToSupplierDistributionListById] An error occured in the processing of Record Id : " + downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
private void FillForm(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { try { DataTable dtb = downPaymentToSupplierDistributionFormBAL.GetDownPaymentToSupplierDistributionListById(downPaymentToSupplierDistributionFormUI); if (dtb.Rows.Count > 0) { txtDownPaymentToSupplier.Text = dtb.Rows[0]["tbl_Supplier"].ToString(); txtDownPaymentToSupplierGuid.Text = dtb.Rows[0]["tbl_DownPaymentToSupplierId"].ToString(); txtGLAccount.Text = dtb.Rows[0]["tbl_GLAccount"].ToString(); txtGLAccountGuid.Text = dtb.Rows[0]["tbl_GLAccountId"].ToString(); ddlOptionType.SelectedValue = dtb.Rows[0]["Type"].ToString(); txtDebit.Text = dtb.Rows[0]["Debit"].ToString(); txtOriginatingDebit.Text = dtb.Rows[0]["OriginatingDebit"].ToString(); txtCredit.Text = dtb.Rows[0]["Credit"].ToString(); txtOriginatingCredit.Text = dtb.Rows[0]["OriginatingCredit"].ToString(); txtDescription.Text = dtb.Rows[0]["Description"].ToString(); txtDistributionReference.Text = dtb.Rows[0]["DistributionReference"].ToString(); } else { lblError.Text = Resources.GlobalResource.msgCouldNotLoadData; divError.Visible = true; } } catch (Exception exp) { logExcpUIobj.MethodName = "FillForm()"; logExcpUIobj.ResourceName = "Finance_Bank_Accounting_Customer_Down_Payment_DownPaymentFromCustomerDistributionForm.CS"; logExcpUIobj.RecordId = downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Finance_Bank_Accounting_Payment_To_Suppliers_DownPaymentToSupplierDistributionForm : FillForm] An error occured in the processing of Record Id : " + downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId + ". Details : [" + exp.ToString() + "]"); } }
protected void Page_Load(object sender, EventArgs e) { DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI = new DownPaymentToSupplierDistributionFormUI(); if (!Page.IsPostBack) { if (Request.QueryString["DownPaymentToSupplierId"] != null) { downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierId = Request.QueryString["DownPaymentToSupplierId"]; BindGetDownPaymentToSupplierDistribution_SelectByDownPaymentToSupplierId(downPaymentToSupplierDistributionFormUI); BindTypeDropDownList(); btnUpdate.Visible = false; btnDelete.Visible = false; } else if (Request.QueryString["DownPaymentToSupplierDistributionId"] != null) { downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierDistributionId = Request.QueryString["DownPaymentToSupplierDistributionId"]; BindTypeDropDownList(); FillForm(downPaymentToSupplierDistributionFormUI); btnSave.Visible = false; btnClear.Visible = false; btnUpdate.Visible = true; btnDelete.Visible = true; lblHeading.Text = "Update DownPaymentToSupplierDistribution"; } else { BindTypeDropDownList(); btnSave.Visible = true; btnClear.Visible = true; btnUpdate.Visible = false; btnDelete.Visible = false; lblHeading.Text = "Add New DownPaymentToSupplierDistribution"; } } }
public int AddDownPaymentToSupplierDistribution(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_DownPaymentToSupplierDistribution_Insert", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar); sqlCmd.Parameters["@CreatedBy"].Value = downPaymentToSupplierDistributionFormUI.CreatedBy; sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_OrganizationId"].Value = downPaymentToSupplierDistributionFormUI.Tbl_OrganizationId; sqlCmd.Parameters.Add("@tbl_DownPaymentToSupplierId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_DownPaymentToSupplierId"].Value = downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierId; sqlCmd.Parameters.Add("@tbl_GLAccountId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_GLAccountId"].Value = downPaymentToSupplierDistributionFormUI.Tbl_GLAccountId; sqlCmd.Parameters.Add("@opt_Type", SqlDbType.Int); sqlCmd.Parameters["@opt_Type"].Value = downPaymentToSupplierDistributionFormUI.opt_Type; sqlCmd.Parameters.Add("@Debit", SqlDbType.Decimal); sqlCmd.Parameters["@Debit"].Value = downPaymentToSupplierDistributionFormUI.Debit; sqlCmd.Parameters.Add("@OriginatingDebit", SqlDbType.Decimal); sqlCmd.Parameters["@OriginatingDebit"].Value = downPaymentToSupplierDistributionFormUI.OriginatingDebit; sqlCmd.Parameters.Add("@Credit", SqlDbType.Decimal); sqlCmd.Parameters["@Credit"].Value = downPaymentToSupplierDistributionFormUI.Credit; sqlCmd.Parameters.Add("@OriginatingCredit", SqlDbType.Decimal); sqlCmd.Parameters["@OriginatingCredit"].Value = downPaymentToSupplierDistributionFormUI.OriginatingCredit; sqlCmd.Parameters.Add("@Description", SqlDbType.NVarChar); sqlCmd.Parameters["@Description"].Value = downPaymentToSupplierDistributionFormUI.Description; sqlCmd.Parameters.Add("@DistributionReference", SqlDbType.NVarChar); sqlCmd.Parameters["@DistributionReference"].Value = downPaymentToSupplierDistributionFormUI.DistributionReference; sqlCmd.Parameters.Add("@CompanyId", SqlDbType.NVarChar); sqlCmd.Parameters["@CompanyId"].Value = downPaymentToSupplierDistributionFormUI.CompanyId; sqlCmd.Parameters.Add("@CorrespondenceCompanyId", SqlDbType.NVarChar); sqlCmd.Parameters["@CorrespondenceCompanyId"].Value = downPaymentToSupplierDistributionFormUI.CorrespondenceCompanyId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "AddDownPaymentToSupplierDistribution()"; logExcpUIobj.ResourceName = "DownPaymentToSupplierDistributionFormDAL.CS"; logExcpUIobj.RecordId = ""; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[DownPaymentToSupplierDistributionFormDAL : AddDownPaymentToSupplierDistribution] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } return(result); }
private void BindGetDownPaymentToSupplierDistribution_SelectByDownPaymentToSupplierId(DownPaymentToSupplierDistributionFormUI downPaymentToSupplierDistributionFormUI) { downPaymentToSupplierDistributionFormUI.Tbl_DownPaymentToSupplierId = Request.QueryString["DownPaymentToSupplierId"]; DataTable dtb = downPaymentToSupplierDistributionFormBAL.GetDownPaymentToSupplierDistribution_SelectByDownPaymentToSupplierId(downPaymentToSupplierDistributionFormUI); { if (dtb.Rows.Count > 0) { txtDownPaymentToSupplier.Text = dtb.Rows[0]["tbl_Supplier"].ToString(); txtDownPaymentToSupplierGuid.Text = dtb.Rows[0]["tbl_DownPaymentToSupplierId"].ToString(); txtSupplierCode.Text = dtb.Rows[0]["SupplierCode"].ToString(); txtPaymentToSupplier.Text = dtb.Rows[0]["tbl_Supplier"].ToString(); txtPaymentNumber.Text = dtb.Rows[0]["tbl_DownPaymentToSupplier"].ToString(); txtDocumentNumber.Text = dtb.Rows[0]["DocumentNumber"].ToString(); txtDocumentType.Text = dtb.Rows[0]["DocumentType"].ToString(); txtCurrencyName.Text = dtb.Rows[0]["CurrencyName"].ToString(); txtfunctionalAmount.Text = dtb.Rows[0]["Total"].ToString(); txtOriginatingAmount.Text = dtb.Rows[0]["Total"].ToString(); gvData.DataSource = dtb; gvData.DataBind(); divError.Visible = false; gvData.Visible = true; } else { gvData.Visible = false; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearFormAppy();", true); } } }