protected void btnUpdate_Click(object sender, EventArgs e) { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail = Inv_IssueDetailManager.GetInv_IssueDetailByID(Int32.Parse(Request.QueryString["inv_IssueDetailID"])); Inv_IssueDetail tempInv_IssueDetail = new Inv_IssueDetail(); tempInv_IssueDetail.Inv_IssueDetailID = inv_IssueDetail.Inv_IssueDetailID; tempInv_IssueDetail.ItemID = Int32.Parse(ddlItem.SelectedValue); tempInv_IssueDetail.Quantity = Decimal.Parse(txtQuantity.Text); tempInv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); tempInv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); tempInv_IssueDetail.AdditionalWithIssueDetailID = Int32.Parse(ddlAdditionalWithIssueDetail.SelectedValue); tempInv_IssueDetail.ExtraField1 = txtExtraField1.Text; tempInv_IssueDetail.ExtraField2 = txtExtraField2.Text; tempInv_IssueDetail.ExtraField3 = txtExtraField3.Text; tempInv_IssueDetail.ExtraField4 = txtExtraField4.Text; tempInv_IssueDetail.ExtraField5 = txtExtraField5.Text; tempInv_IssueDetail.AddedBy =getLogin().LoginID; tempInv_IssueDetail.AddedDate = DateTime.Now; tempInv_IssueDetail.UpdatedBy = getLogin().LoginID; tempInv_IssueDetail.UpdatedDate = DateTime.Now; tempInv_IssueDetail.RowStatusID = 1; bool result = Inv_IssueDetailManager.UpdateInv_IssueDetail(tempInv_IssueDetail); Response.Redirect("AdminInv_IssueDetailDisplay.aspx"); }
public bool UpdateInv_IssueDetail(Inv_IssueDetail inv_IssueDetail) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("GP_UpdateInv_IssueDetail", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Inv_IssueDetailID", SqlDbType.Int).Value = inv_IssueDetail.Inv_IssueDetailID; cmd.Parameters.Add("@ItemID", SqlDbType.Int).Value = inv_IssueDetail.ItemID; cmd.Parameters.Add("@Quantity", SqlDbType.Decimal).Value = inv_IssueDetail.Quantity; cmd.Parameters.Add("@ApproximateQuantity", SqlDbType.Int).Value = inv_IssueDetail.ApproximateQuantity; cmd.Parameters.Add("@ProductID", SqlDbType.Int).Value = inv_IssueDetail.ProductID; cmd.Parameters.Add("@AdditionalWithIssueDetailID", SqlDbType.Int).Value = inv_IssueDetail.AdditionalWithIssueDetailID; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = inv_IssueDetail.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = inv_IssueDetail.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = inv_IssueDetail.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = inv_IssueDetail.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = inv_IssueDetail.ExtraField5; cmd.Parameters.Add("@AddedBy", SqlDbType.Int).Value = inv_IssueDetail.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = inv_IssueDetail.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value = inv_IssueDetail.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = inv_IssueDetail.UpdatedDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = inv_IssueDetail.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
protected void btnUpdate_Click(object sender, EventArgs e) { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail = Inv_IssueDetailManager.GetInv_IssueDetailByID(Int32.Parse(Request.QueryString["inv_IssueDetailID"])); Inv_IssueDetail tempInv_IssueDetail = new Inv_IssueDetail(); tempInv_IssueDetail.Inv_IssueDetailID = inv_IssueDetail.Inv_IssueDetailID; tempInv_IssueDetail.ItemID = Int32.Parse(ddlItem.SelectedValue); tempInv_IssueDetail.Quantity = Decimal.Parse(txtQuantity.Text); tempInv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); tempInv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); tempInv_IssueDetail.AdditionalWithIssueDetailID = Int32.Parse(ddlAdditionalWithIssueDetail.SelectedValue); tempInv_IssueDetail.ExtraField1 = txtExtraField1.Text; tempInv_IssueDetail.ExtraField2 = txtExtraField2.Text; tempInv_IssueDetail.ExtraField3 = txtExtraField3.Text; tempInv_IssueDetail.ExtraField4 = txtExtraField4.Text; tempInv_IssueDetail.ExtraField5 = txtExtraField5.Text; tempInv_IssueDetail.AddedBy = getLogin().LoginID; tempInv_IssueDetail.AddedDate = DateTime.Now; tempInv_IssueDetail.UpdatedBy = getLogin().LoginID; tempInv_IssueDetail.UpdatedDate = DateTime.Now; tempInv_IssueDetail.RowStatusID = 1; bool result = Inv_IssueDetailManager.UpdateInv_IssueDetail(tempInv_IssueDetail); Response.Redirect("AdminInv_IssueDetailDisplay.aspx"); }
public static Inv_IssueDetail GetInv_IssueDetailByID(int id) { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); SqlInv_IssueDetailProvider sqlInv_IssueDetailProvider = new SqlInv_IssueDetailProvider(); inv_IssueDetail = sqlInv_IssueDetailProvider.GetInv_IssueDetailByID(id); return(inv_IssueDetail); }
public Inv_IssueDetail GetInv_IssueDetailFromReader(IDataReader reader) { try { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail ( (int)reader["Inv_IssueDetailID"], (int)reader["ItemID"], (decimal)reader["Quantity"], (int)reader["ApproximateQuantity"], (int)reader["ProductID"], (int)reader["AdditionalWithIssueDetailID"], reader["ExtraField1"].ToString(), reader["ExtraField2"].ToString(), reader["ExtraField3"].ToString(), reader["ExtraField4"].ToString(), reader["ExtraField5"].ToString(), (int)reader["AddedBy"], (DateTime)reader["AddedDate"], (int)reader["UpdatedBy"], (DateTime)reader["UpdatedDate"], (int)reader["RowStatusID"] ); try{ inv_IssueDetail.ItemCode = reader["ItemCode"].ToString(); } catch (Exception ex) {} try{ inv_IssueDetail.ItemName = reader["ItemName"].ToString(); } catch (Exception ex) {} try { inv_IssueDetail.PricePerUnit = (decimal)reader["PricePerUnit"]; } catch (Exception ex) { } try { inv_IssueDetail.TotalPrice = inv_IssueDetail.PricePerUnit * inv_IssueDetail.Quantity; } catch (Exception ex) { } try { inv_IssueDetail.QuantityUnitName = reader["QuantityUnitName"].ToString(); } catch (Exception ex) { } try { inv_IssueDetail.QualityUnitName = reader["QualityUnitName"].ToString(); } catch (Exception ex) { } try { inv_IssueDetail.QualityUnitValue = (decimal)reader["QualityValue"]; } catch (Exception ex) { } try { inv_IssueDetail.ProductName = reader["ProductName"].ToString(); } catch (Exception ex) { inv_IssueDetail.ProductName = "N/A"; } try { inv_IssueDetail.ACC_HeadTypeID = (int)reader["ACC_HeadTypeID"]; } catch (Exception ex) { inv_IssueDetail.ACC_HeadTypeID = 0; } try { inv_IssueDetail.RawMaterialID = (int)reader["RawMaterialID"]; } catch (Exception ex) { inv_IssueDetail.RawMaterialID = 0; } return(inv_IssueDetail); } catch (Exception ex) { return(null); } }
private void showInv_IssueDetailData() { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail = Inv_IssueDetailManager.GetInv_IssueDetailByID(Int32.Parse(Request.QueryString["inv_IssueDetailID"])); ddlItem.SelectedValue = inv_IssueDetail.ItemID.ToString(); txtQuantity.Text = inv_IssueDetail.Quantity.ToString(); txtApproximateQuantity.Text = inv_IssueDetail.ApproximateQuantity.ToString(); ddlProduct.SelectedValue = inv_IssueDetail.ProductID.ToString(); }
private void showInv_IssueDetailData() { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail = Inv_IssueDetailManager.GetInv_IssueDetailByID(Int32.Parse(Request.QueryString["inv_IssueDetailID"])); ddlItem.SelectedValue = inv_IssueDetail.ItemID.ToString(); txtQuantity.Text = inv_IssueDetail.Quantity.ToString(); txtApproximateQuantity.Text = inv_IssueDetail.ApproximateQuantity.ToString(); ddlProduct.SelectedValue = inv_IssueDetail.ProductID.ToString(); ddlAdditionalWithIssueDetail.SelectedValue = inv_IssueDetail.AdditionalWithIssueDetailID.ToString(); txtExtraField1.Text = inv_IssueDetail.ExtraField1; txtExtraField2.Text = inv_IssueDetail.ExtraField2; txtExtraField3.Text = inv_IssueDetail.ExtraField3; txtExtraField4.Text = inv_IssueDetail.ExtraField4; txtExtraField5.Text = inv_IssueDetail.ExtraField5; txtAddedBy.Text = inv_IssueDetail.AddedBy.ToString(); txtUpdatedBy.Text = inv_IssueDetail.UpdatedBy.ToString(); txtUpdatedDate.Text = inv_IssueDetail.UpdatedDate; ddlRowStatus.SelectedValue = inv_IssueDetail.RowStatusID.ToString(); }
protected void btnAdd_Click(object sender, EventArgs e) { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail.ItemID = Int32.Parse(ddlItem.SelectedValue); inv_IssueDetail.Quantity = Decimal.Parse(txtQuantity.Text); inv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); inv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); inv_IssueDetail.AdditionalWithIssueDetailID = Int32.Parse(ddlAdditionalWithIssueDetail.SelectedValue); inv_IssueDetail.ExtraField1 = txtExtraField1.Text; inv_IssueDetail.ExtraField2 = txtExtraField2.Text; inv_IssueDetail.ExtraField3 = txtExtraField3.Text; inv_IssueDetail.ExtraField4 = txtExtraField4.Text; inv_IssueDetail.ExtraField5 = txtExtraField5.Text; inv_IssueDetail.AddedBy =getLogin().LoginID; inv_IssueDetail.AddedDate = DateTime.Now; inv_IssueDetail.UpdatedBy = getLogin().LoginID; inv_IssueDetail.UpdatedDate = DateTime.Now; inv_IssueDetail.RowStatusID = 1; int resutl = Inv_IssueDetailManager.InsertInv_IssueDetail(inv_IssueDetail); Response.Redirect("AdminInv_IssueDetailDisplay.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail.ItemID = Int32.Parse(ddlItem.SelectedValue); inv_IssueDetail.Quantity = Decimal.Parse(txtQuantity.Text); inv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); inv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); inv_IssueDetail.AdditionalWithIssueDetailID = Int32.Parse(ddlAdditionalWithIssueDetail.SelectedValue); inv_IssueDetail.ExtraField1 = txtExtraField1.Text; inv_IssueDetail.ExtraField2 = txtExtraField2.Text; inv_IssueDetail.ExtraField3 = txtExtraField3.Text; inv_IssueDetail.ExtraField4 = txtExtraField4.Text; inv_IssueDetail.ExtraField5 = txtExtraField5.Text; inv_IssueDetail.AddedBy = getLogin().LoginID; inv_IssueDetail.AddedDate = DateTime.Now; inv_IssueDetail.UpdatedBy = getLogin().LoginID; inv_IssueDetail.UpdatedDate = DateTime.Now; inv_IssueDetail.RowStatusID = 1; int resutl = Inv_IssueDetailManager.InsertInv_IssueDetail(inv_IssueDetail); Response.Redirect("AdminInv_IssueDetailDisplay.aspx"); }
public static Inv_IssueDetail GetInv_IssueDetailByID(int id) { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); SqlInv_IssueDetailProvider sqlInv_IssueDetailProvider = new SqlInv_IssueDetailProvider(); inv_IssueDetail = sqlInv_IssueDetailProvider.GetInv_IssueDetailByID(id); return inv_IssueDetail; }
public static bool UpdateInv_IssueDetail(Inv_IssueDetail inv_IssueDetail) { SqlInv_IssueDetailProvider sqlInv_IssueDetailProvider = new SqlInv_IssueDetailProvider(); return(sqlInv_IssueDetailProvider.UpdateInv_IssueDetail(inv_IssueDetail)); }
public static int InsertInv_IssueDetail(Inv_IssueDetail inv_IssueDetail) { SqlInv_IssueDetailProvider sqlInv_IssueDetailProvider = new SqlInv_IssueDetailProvider(); return(sqlInv_IssueDetailProvider.InsertInv_IssueDetail(inv_IssueDetail)); }
protected void btnAdd_Click(object sender, EventArgs e) { //if(Request.QueryString["IsNonProduction"] == null) //addConfiguration(); if (Request.QueryString["IsNonProduction"] != null) { txtApproximateQuantity.Text = txtQuantity.Text; } if (hfInv_IssueMasterID.Value == "0" || hfInv_IssueMasterID.Value == "") { Inv_IssueMaster inv_IssueMaster = new Inv_IssueMaster(); inv_IssueMaster.IssueName = ""; inv_IssueMaster.IssueDate = DateTime.Parse(txtIssueDate.Text); inv_IssueMaster.EmployeeID = Int32.Parse(ddlEmployee.SelectedValue); inv_IssueMaster.WorkSatationID = Int32.Parse(ddlWorkSatation.SelectedValue); inv_IssueMaster.Particulars = txtParticulars.Text; inv_IssueMaster.IsIssue = (Request.QueryString["IsNonProduction"] != null ?false:true); inv_IssueMaster.ExtraField1 = ""; inv_IssueMaster.ExtraField2 = ""; inv_IssueMaster.ExtraField3 = ""; inv_IssueMaster.ExtraField4 = ""; inv_IssueMaster.ExtraField5 = ""; inv_IssueMaster.AddedBy = getLogin().LoginID; inv_IssueMaster.AddedDate = DateTime.Now; inv_IssueMaster.UpdatedBy = getLogin().LoginID; inv_IssueMaster.UpdatedDate = DateTime.Now; inv_IssueMaster.RowStatusID = 1; hfInv_IssueMasterID.Value = Inv_IssueMasterManager.InsertInv_IssueMaster(inv_IssueMaster).ToString(); } Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail.ItemID = Int32.Parse(ddlItem.SelectedValue); inv_IssueDetail.Quantity = Decimal.Parse(txtQuantity.Text); inv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); if (ddlIssuedItem.Items.Count == 0 || ddlIssuedItem.SelectedValue == "0") { inv_IssueDetail.AdditionalWithIssueDetailID = 0; inv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); } else { inv_IssueDetail.AdditionalWithIssueDetailID = int.Parse(ddlIssuedItem.SelectedValue); inv_IssueDetail.ApproximateQuantity = 0; } //inv_IssueDetail.ExtraField1 = ddlItem.SelectedItem.Text.Split(' ')[0]; //Item COde //inv_IssueDetail.ExtraField2 = ddlItem.SelectedItem.Text.Split('{')[0].Trim().Replace(inv_IssueDetail.ExtraField1 +" - ","");//item Name //inv_IssueDetail.ExtraField3 = ddlItem.SelectedItem.Text.Split('{')[1].Split('}')[0];//quality //inv_IssueDetail.ExtraField4 = Request.QueryString["IsNonProduction"] != null ?"":ddlProduct.SelectedItem.Text;//productName //inv_IssueDetail.ExtraField5 = Inv_ItemManager.GetInv_ItemByID(Int32.Parse(ddlItem.SelectedValue)).PricePerUnit.ToString("0,0.00");//Price Per unit inv_IssueDetail.ExtraField1 = txtQuantity.Text; inv_IssueDetail.ExtraField2 = "0"; inv_IssueDetail.ExtraField3 = "0"; inv_IssueDetail.ExtraField4 = "0"; inv_IssueDetail.ExtraField5 = hfInv_IssueMasterID.Value; inv_IssueDetail.AddedBy = getLogin().LoginID; inv_IssueDetail.AddedDate = DateTime.Now; inv_IssueDetail.UpdatedBy = getLogin().LoginID; inv_IssueDetail.UpdatedDate = DateTime.Now; inv_IssueDetail.RowStatusID = 1; Inv_IssueDetailManager.InsertInv_IssueDetail(inv_IssueDetail); showInv_IssueDetailGrid(); //btnClear_Click(this, new EventArgs()); }
protected void btnAdd_Click(object sender, EventArgs e) { if (!checking()) { return; } Inv_IssueMaster inv_IssueMaster = new Inv_IssueMaster(); inv_IssueMaster.IssueName = ""; inv_IssueMaster.IssueDate = DateTime.Parse(txtIssueDate.Text); inv_IssueMaster.EmployeeID = Int32.Parse(ddlEmployee.SelectedValue); inv_IssueMaster.WorkSatationID = Int32.Parse(ddlWorkSatation.SelectedValue); inv_IssueMaster.Particulars = txtParticulars.Text; inv_IssueMaster.IsIssue = (Request.QueryString["IsNonProduction"] != null ? false : true); inv_IssueMaster.ExtraField1 = ""; inv_IssueMaster.ExtraField2 = ""; inv_IssueMaster.ExtraField3 = ""; inv_IssueMaster.ExtraField4 = ""; inv_IssueMaster.ExtraField5 = ""; inv_IssueMaster.AddedBy = getLogin().LoginID; inv_IssueMaster.AddedDate = DateTime.Now; inv_IssueMaster.UpdatedBy = getLogin().LoginID; inv_IssueMaster.UpdatedDate = DateTime.Now; inv_IssueMaster.RowStatusID = 1; if (txtOldIssueID.Text == "") { inv_IssueMaster.Inv_IssueMasterID = Inv_IssueMasterManager.InsertInv_IssueMaster(inv_IssueMaster); } else { inv_IssueMaster.Inv_IssueMasterID = int.Parse(txtOldIssueID.Text); } int JournalMasterID = 0; foreach (GridViewRow gvr in gvInv_Item.Rows) { HiddenField hfInv_ItemID = (HiddenField)gvr.FindControl("hfInv_ItemID"); Label lblPurchaseID = (Label)gvr.FindControl("lblPurchaseID"); TextBox txtIssueQuantity = (TextBox)gvr.FindControl("txtIssueQuantity"); TextBox txtApproximateQuantity = (TextBox)gvr.FindControl("txtApproximateQuantity"); DropDownList ddlProduct = (DropDownList)gvr.FindControl("ddlProduct"); HiddenField hfRawMaterialTypeID = (HiddenField)gvr.FindControl("hfRawMaterialTypeID"); if (hfRawMaterialTypeID.Value == "10" && JournalMasterID == 0) { if (ddlWorkSatation.SelectedValue != "1") { //Journal Entry ACC_JournalMaster aCC_JournalMaster = new ACC_JournalMaster(); aCC_JournalMaster.JournalMasterName = "3";//Journal Voucher aCC_JournalMaster.ExtraField1 = ddlWorkSatation.SelectedItem.Text; aCC_JournalMaster.ExtraField2 = ""; aCC_JournalMaster.ExtraField3 = ""; aCC_JournalMaster.Note = "Inventory Issue-" + inv_IssueMaster.Inv_IssueMasterID.ToString(); aCC_JournalMaster.JournalDate = DateTime.Parse(txtIssueDate.Text); aCC_JournalMaster.AddedBy = getLogin().LoginID; aCC_JournalMaster.AddedDate = DateTime.Now; aCC_JournalMaster.UpdatedBy = getLogin().LoginID; aCC_JournalMaster.UpdatedDate = DateTime.Now; aCC_JournalMaster.RowStatusID = 1; JournalMasterID = ACC_JournalMasterManager.InsertACC_JournalMaster(aCC_JournalMaster); } } Label lblAvailableQuantity = (Label)gvr.FindControl("lblExtraFieldQuantity1"); if (txtIssueQuantity.Text != "0" && txtIssueQuantity.Text != "") { Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail.ItemID = Int32.Parse(hfInv_ItemID.Value); inv_IssueDetail.Quantity = Decimal.Parse(txtIssueQuantity.Text); inv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); inv_IssueDetail.AdditionalWithIssueDetailID = 0; inv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); inv_IssueDetail.ExtraField1 = txtIssueQuantity.Text; inv_IssueDetail.ExtraField2 = "0"; inv_IssueDetail.ExtraField3 = "0"; inv_IssueDetail.ExtraField4 = (hfRawMaterialTypeID.Value == "10"?JournalMasterID.ToString():"0"); inv_IssueDetail.ExtraField5 = inv_IssueMaster.Inv_IssueMasterID.ToString(); inv_IssueDetail.AddedBy = getLogin().LoginID; inv_IssueDetail.AddedDate = DateTime.Now; inv_IssueDetail.UpdatedBy = getLogin().LoginID; inv_IssueDetail.UpdatedDate = DateTime.Now; inv_IssueDetail.RowStatusID = 1; if (Inv_IssueDetailManager.InsertInv_IssueDetail(inv_IssueDetail) <= 0) { showAlartMessage("Double Pressed"); return; } } } hlnkIssuePrint.NavigateUrl = "IssuePrint.aspx?IssueID=" + inv_IssueMaster.Inv_IssueMasterID.ToString(); hlnkIssuePrint.Visible = true; showInv_IssueDetailGrid(); }
protected void btnAdd_Click(object sender, EventArgs e) { //if(Request.QueryString["IsNonProduction"] == null) //addConfiguration(); if (Request.QueryString["IsNonProduction"] != null) { txtApproximateQuantity.Text = txtQuantity.Text; } if (hfInv_IssueMasterID.Value == "0" || hfInv_IssueMasterID.Value == "") { Inv_IssueMaster inv_IssueMaster = new Inv_IssueMaster(); inv_IssueMaster.IssueName = ""; inv_IssueMaster.IssueDate = DateTime.Parse(txtIssueDate.Text); inv_IssueMaster.EmployeeID = Int32.Parse(ddlEmployee.SelectedValue); inv_IssueMaster.WorkSatationID = Int32.Parse(ddlWorkSatation.SelectedValue); inv_IssueMaster.Particulars = txtParticulars.Text; inv_IssueMaster.IsIssue =( Request.QueryString["IsNonProduction"] != null ?false:true); inv_IssueMaster.ExtraField1 = ""; inv_IssueMaster.ExtraField2 = ""; inv_IssueMaster.ExtraField3 = ""; inv_IssueMaster.ExtraField4 = ""; inv_IssueMaster.ExtraField5 = ""; inv_IssueMaster.AddedBy = getLogin().LoginID; inv_IssueMaster.AddedDate = DateTime.Now; inv_IssueMaster.UpdatedBy = getLogin().LoginID; inv_IssueMaster.UpdatedDate = DateTime.Now; inv_IssueMaster.RowStatusID = 1; hfInv_IssueMasterID.Value = Inv_IssueMasterManager.InsertInv_IssueMaster(inv_IssueMaster).ToString(); } Inv_IssueDetail inv_IssueDetail = new Inv_IssueDetail(); inv_IssueDetail.ItemID = Int32.Parse(ddlItem.SelectedValue); inv_IssueDetail.Quantity = Decimal.Parse(txtQuantity.Text); inv_IssueDetail.ProductID = Int32.Parse(ddlProduct.SelectedValue); if (ddlIssuedItem.Items.Count == 0 || ddlIssuedItem.SelectedValue == "0") { inv_IssueDetail.AdditionalWithIssueDetailID = 0; inv_IssueDetail.ApproximateQuantity = Int32.Parse(txtApproximateQuantity.Text); } else { inv_IssueDetail.AdditionalWithIssueDetailID = int.Parse(ddlIssuedItem.SelectedValue); inv_IssueDetail.ApproximateQuantity = 0; } //inv_IssueDetail.ExtraField1 = ddlItem.SelectedItem.Text.Split(' ')[0]; //Item COde //inv_IssueDetail.ExtraField2 = ddlItem.SelectedItem.Text.Split('{')[0].Trim().Replace(inv_IssueDetail.ExtraField1 +" - ","");//item Name //inv_IssueDetail.ExtraField3 = ddlItem.SelectedItem.Text.Split('{')[1].Split('}')[0];//quality //inv_IssueDetail.ExtraField4 = Request.QueryString["IsNonProduction"] != null ?"":ddlProduct.SelectedItem.Text;//productName //inv_IssueDetail.ExtraField5 = Inv_ItemManager.GetInv_ItemByID(Int32.Parse(ddlItem.SelectedValue)).PricePerUnit.ToString("0,0.00");//Price Per unit inv_IssueDetail.ExtraField1 = txtQuantity.Text; inv_IssueDetail.ExtraField2 = "0"; inv_IssueDetail.ExtraField3 = "0"; inv_IssueDetail.ExtraField4 = "0"; inv_IssueDetail.ExtraField5 = hfInv_IssueMasterID.Value; inv_IssueDetail.AddedBy =getLogin().LoginID; inv_IssueDetail.AddedDate = DateTime.Now; inv_IssueDetail.UpdatedBy = getLogin().LoginID; inv_IssueDetail.UpdatedDate = DateTime.Now; inv_IssueDetail.RowStatusID = 1; Inv_IssueDetailManager.InsertInv_IssueDetail(inv_IssueDetail); showInv_IssueDetailGrid(); //btnClear_Click(this, new EventArgs()); }
public static bool UpdateInv_IssueDetail(Inv_IssueDetail inv_IssueDetail) { SqlInv_IssueDetailProvider sqlInv_IssueDetailProvider = new SqlInv_IssueDetailProvider(); return sqlInv_IssueDetailProvider.UpdateInv_IssueDetail(inv_IssueDetail); }
public static int InsertInv_IssueDetail(Inv_IssueDetail inv_IssueDetail) { SqlInv_IssueDetailProvider sqlInv_IssueDetailProvider = new SqlInv_IssueDetailProvider(); return sqlInv_IssueDetailProvider.InsertInv_IssueDetail(inv_IssueDetail); }