public int DeleteGoodsReceivedNote(GoodsReceivedNoteFormUI goodsReceivedNoteFormUI) { int resutl = 0; resutl = goodsReceivedNoteFormDAL.DeleteGoodsReceivedNote(goodsReceivedNoteFormUI); return(resutl); }
public DataTable GetGoodsReceivedNoteListById(GoodsReceivedNoteFormUI goodsReceivedNoteFormUI) { DataTable dtb = new DataTable(); dtb = goodsReceivedNoteFormDAL.GetGoodsReceivedNoteListById(goodsReceivedNoteFormUI); return(dtb); }
protected void Page_Load(object sender, EventArgs e) { GoodsReceivedNoteFormUI goodsReceivedNoteFormUI = new GoodsReceivedNoteFormUI(); if (!Page.IsPostBack) { BindReceivedTypeDropDownList(); if (Request.QueryString["GoodsReceivedNoteId"] != null) { goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId = Request.QueryString["GoodsReceivedNoteId"]; BindReceivedTypeDropDownList(); FillForm(goodsReceivedNoteFormUI); btnSave.Visible = false; btnClear.Visible = false; btnUpdate.Visible = true; btnDelete.Visible = true; lblHeading.Text = "Update Good Received Note"; } else { BindReceivedTypeDropDownList(); btnSave.Visible = true; btnClear.Visible = true; btnUpdate.Visible = false; btnDelete.Visible = false; lblHeading.Text = "Add New Good Received Note"; } } }
protected void btnUpdate_Click(object sender, EventArgs e) { GoodsReceivedNoteFormUI goodsReceivedNoteFormUI = new GoodsReceivedNoteFormUI(); try { goodsReceivedNoteFormUI.ModifiedBy = SessionContext.UserGuid; goodsReceivedNoteFormUI.Tbl_OrganizationId = SessionContext.OrganizationId; goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId = Request.QueryString["GoodsReceivedNoteId"]; goodsReceivedNoteFormUI.Tbl_BatchId = txtBatchGuid.Text; goodsReceivedNoteFormUI.Tbl_CurrencyId = txtCurrencyGuid.Text; goodsReceivedNoteFormUI.Tbl_SupplierId = txtSupplierGuid.Text; goodsReceivedNoteFormUI.opt_ReceivedType = int.Parse(ddlOpt_ReceivedType.SelectedValue.ToString()); goodsReceivedNoteFormUI.GoodsReceivedNoteNumber = txtGoodsReceivedNoteNumber.Text; goodsReceivedNoteFormUI.SupplierDocumentNumber = txtSupplierDocumentNumber.Text; goodsReceivedNoteFormUI.Date = DateTime.Parse(txtDate.Text); goodsReceivedNoteFormUI.SubTotal = Decimal.Parse(txtSubTotal.Text); goodsReceivedNoteFormUI.TradeDiscount = Decimal.Parse(txtTradeDiscount.Text); goodsReceivedNoteFormUI.Freight = Decimal.Parse(txtFreight.Text); goodsReceivedNoteFormUI.Miscellaneous = Decimal.Parse(txtMiscellaneous.Text); goodsReceivedNoteFormUI.Total = Decimal.Parse(txtTotal.Text); if (goodsReceivedNoteFormBAL.UpdateGoodsReceivedNote(goodsReceivedNoteFormUI) == 1) { divSuccess.Visible = true; divError.Visible = false; lblSuccess.Text = Resources.GlobalResource.msgRecordUpdatedSuccessfully; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearForm();", true); } else { divError.Visible = true; divSuccess.Visible = false; lblError.Text = Resources.GlobalResource.msgCouldNotUpdateRecord; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearForm();", true); } } catch (Exception exp) { logExcpUIobj.MethodName = "btnUpdate_Click()"; logExcpUIobj.ResourceName = "Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteForm.CS"; logExcpUIobj.RecordId = ""; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteForm : btnUpdate_Click] An error occured in the processing of Record Id : " + goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId + ". Details : [" + exp.ToString() + "]"); } }
public DataTable GetGoodsReceivedNoteListById(GoodsReceivedNoteFormUI goodsReceivedNoteFormUI) { DataSet ds = new DataSet(); DataTable dtbl = new DataTable(); try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SqlCommand sqlCmd = new SqlCommand("SP_GoodsReceivedNote_SelectById", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_GoodsReceivedNoteId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_GoodsReceivedNoteId"].Value = goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId; using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd)) { adapter.Fill(ds); } } if (ds.Tables.Count > 0) { dtbl = ds.Tables[0]; } } catch (Exception exp) { logExcpUIobj.MethodName = "getGoodsReceivedNoteListById()"; logExcpUIobj.ResourceName = "GoodsReceivedNoteFormDAL.CS"; logExcpUIobj.RecordId = goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[GoodsReceivedNoteFormDAL : getGoodsReceivedNoteListById] An error occured in the processing of Record Id : " + goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId + ". Details : [" + exp.ToString() + "]"); } finally { ds.Dispose(); } return(dtbl); }
private void FillForm(GoodsReceivedNoteFormUI goodsReceivedNoteFormUI) { try { DataTable dtb = goodsReceivedNoteFormBAL.GetGoodsReceivedNoteListById(goodsReceivedNoteFormUI); if (dtb.Rows.Count > 0) { txtBatchGuid.Text = dtb.Rows[0]["tbl_BatchId"].ToString(); txtBatch.Text = dtb.Rows[0]["tbl_Batch"].ToString(); txtCurrencyGuid.Text = dtb.Rows[0]["tbl_CurrencyId"].ToString(); txtCurrency.Text = dtb.Rows[0]["CurrencyName"].ToString(); txtSupplierGuid.Text = dtb.Rows[0]["tbl_SupplierId"].ToString(); txtSupplier.Text = dtb.Rows[0]["tbl_Supplier"].ToString(); ddlOpt_ReceivedType.SelectedValue = dtb.Rows[0]["Opt_ReceivedType"].ToString(); txtGoodsReceivedNoteNumber.Text = dtb.Rows[0]["GoodsReceivedNoteNumber"].ToString(); txtSupplierDocumentNumber.Text = dtb.Rows[0]["SupplierDocumentNumber"].ToString(); txtDate.Text = dtb.Rows[0]["Date"].ToString(); txtSubTotal.Text = dtb.Rows[0]["SubTotal"].ToString(); txtTradeDiscount.Text = dtb.Rows[0]["TradeDiscount"].ToString(); txtFreight.Text = dtb.Rows[0]["Freight"].ToString(); txtMiscellaneous.Text = dtb.Rows[0]["Miscellaneous"].ToString(); txtTotal.Text = dtb.Rows[0]["Total"].ToString(); } else { lblError.Text = Resources.GlobalResource.msgCouldNotLoadData; divError.Visible = true; } } catch (Exception exp) { logExcpUIobj.MethodName = "FillForm()"; logExcpUIobj.ResourceName = "Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteForm.CS"; logExcpUIobj.RecordId = goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteForm : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]"); } }
public int DeleteGoodsReceivedNote(GoodsReceivedNoteFormUI goodsReceivedNoteFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_GoodsReceivedNote_Delete", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@tbl_GoodsReceivedNoteId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_GoodsReceivedNoteId"].Value = goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "DeleteGoodsReceivedNote()"; logExcpUIobj.ResourceName = "GoodsReceivedNoteFormDAL.CS"; logExcpUIobj.RecordId = goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[GoodsReceivedNoteFormDAL : DeleteGoodsReceivedNote] An error occured in the processing of Record Id : " + goodsReceivedNoteFormUI.Tbl_GoodsReceivedNoteId + ". Details : [" + exp.ToString() + "]"); } return(result); }
public int AddGoodsReceivedNote(GoodsReceivedNoteFormUI goodsReceivedNoteFormUI) { int result = 0; try { using (SqlConnection SupportCon = new SqlConnection(connectionString)) { SupportCon.Open(); SqlCommand sqlCmd = new SqlCommand("SP_GoodsReceivedNote_Insert", SupportCon); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar); sqlCmd.Parameters["@CreatedBy"].Value = goodsReceivedNoteFormUI.CreatedBy; sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_OrganizationId"].Value = goodsReceivedNoteFormUI.Tbl_OrganizationId; sqlCmd.Parameters.Add("@opt_ReceivedType", SqlDbType.TinyInt); sqlCmd.Parameters["@opt_ReceivedType"].Value = goodsReceivedNoteFormUI.opt_ReceivedType; sqlCmd.Parameters.Add("@GoodsReceivedNoteNumber", SqlDbType.NVarChar); sqlCmd.Parameters["@GoodsReceivedNoteNumber"].Value = goodsReceivedNoteFormUI.GoodsReceivedNoteNumber; sqlCmd.Parameters.Add("@tbl_SupplierId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_SupplierId"].Value = goodsReceivedNoteFormUI.Tbl_SupplierId; sqlCmd.Parameters.Add("@SupplierDocumentNumber", SqlDbType.NVarChar); sqlCmd.Parameters["@SupplierDocumentNumber"].Value = goodsReceivedNoteFormUI.SupplierDocumentNumber; sqlCmd.Parameters.Add("@Date", SqlDbType.DateTime); sqlCmd.Parameters["@Date"].Value = goodsReceivedNoteFormUI.Date; sqlCmd.Parameters.Add("@tbl_CurrencyId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_CurrencyId"].Value = goodsReceivedNoteFormUI.Tbl_CurrencyId; sqlCmd.Parameters.Add("@tbl_BatchId", SqlDbType.NVarChar); sqlCmd.Parameters["@tbl_BatchId"].Value = goodsReceivedNoteFormUI.Tbl_BatchId; sqlCmd.Parameters.Add("@SubTotal", SqlDbType.Decimal); sqlCmd.Parameters["@SubTotal"].Value = goodsReceivedNoteFormUI.SubTotal; sqlCmd.Parameters.Add("@TradeDiscount", SqlDbType.Decimal); sqlCmd.Parameters["@TradeDiscount"].Value = goodsReceivedNoteFormUI.TradeDiscount; sqlCmd.Parameters.Add("@Freight", SqlDbType.Decimal); sqlCmd.Parameters["@Freight"].Value = goodsReceivedNoteFormUI.Freight; sqlCmd.Parameters.Add("@Miscellaneous", SqlDbType.Decimal); sqlCmd.Parameters["@Miscellaneous"].Value = goodsReceivedNoteFormUI.Miscellaneous; sqlCmd.Parameters.Add("@Total", SqlDbType.Decimal); sqlCmd.Parameters["@Total"].Value = goodsReceivedNoteFormUI.Total; result = sqlCmd.ExecuteNonQuery(); sqlCmd.Dispose(); SupportCon.Close(); } } catch (Exception exp) { logExcpUIobj.MethodName = "AddGoodsReceivedNote()"; logExcpUIobj.ResourceName = "GoodsReceivedNoteFormDAL.CS"; logExcpUIobj.RecordId = ""; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); log.Error("[GoodsReceivedNoteFormDAL : AddGoodsReceivedNote] An error occured in the processing of Record. Details : [" + exp.ToString() + "]"); } return(result); }