public static INV_Issue GetINV_IssueMasterByIssueMasterID(int IssueMasterID) { INV_Issue iNV_Issue = new INV_Issue(); SqlINV_IssueProvider sqlINV_IssueProvider = new SqlINV_IssueProvider(); iNV_Issue = sqlINV_IssueProvider.GetINV_IssueByIssueMasterID(IssueMasterID); return iNV_Issue; }
protected void btnUpdate_OnClick(object sender, EventArgs e) { lblMessage.Text = ""; INV_Issue issue = new INV_Issue(); issue.IssueMasterID = Convert.ToInt32(hdnIssueMasterID.Value); issue.IssueID = Convert.ToInt32(hdnIssueID.Value); issue.IssueNo = txtIssueNo.Text.Trim(); issue.StoreID = Convert.ToInt32(ddlStoreFromID.SelectedValue); issue.ItemID = Convert.ToInt32(ddlItemList.SelectedValue); issue.Quantity = Convert.ToDecimal(txtQty.Text.Trim()); issue.TagID = txtTagID.Text.Trim(); issue.IssueDate = Convert.ToDateTime(txtIssueDate.Text.Trim()); issue.ProductionCode = "0"; //string userID = Profile.card_id; issue.UpdatedBy = Profile.card_id; issue.UpdatedDate = DateTime.Now; INV_IssueMaster issueMaster = new INV_IssueMaster(); if (hdnIssueMasterID.Value != string.Empty) { issueMaster = INV_IssueMasterManager.GetINV_IssueMasterByIssueMasterID(Convert.ToInt32(hdnIssueMasterID.Value)); if (issueMaster != null) { issueMaster.Quantity = issueMaster.Quantity - ((Convert.ToDecimal(hdnTotalQnty.Value)) - Convert.ToDecimal(txtQty.Text.Trim())); issueMaster.UpdatedBy = Profile.card_id; issueMaster.UpdatedDate = DateTime.Now; INV_IssueMasterManager.UpdateINV_IssueMaster(issueMaster); } } bool result = INV_IssueManager.UpdateINV_Issue(issue); if (result == true) { lblFinalMessage.Text = "Updated Successfully"; } else { lblFinalMessage.Text = "Updating Failed"; } Response.Redirect("AdminDisplayINV_Issue.aspx"); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { INV_Issue iNV_Issue = new INV_Issue(); iNV_Issue.IssueID = int.Parse(Request.QueryString["ID"].ToString()); iNV_Issue.CampusID = int.Parse(ddlCampusID.SelectedValue); iNV_Issue.IssueMasterID = int.Parse(ddlIssueMasterID.SelectedValue); iNV_Issue.StoreID = int.Parse(ddlStoreID.SelectedValue); iNV_Issue.ProductionCode = txtProductionCode.Text; iNV_Issue.Quantity = decimal.Parse(txtQuantity.Text); iNV_Issue.IssueDate = DateTime.Parse(txtIssueDate.Text); iNV_Issue.AddedBy = Profile.card_id; iNV_Issue.AddedDate = DateTime.Now; iNV_Issue.UpdatedBy = Profile.card_id; iNV_Issue.UpdatedDate = DateTime.Now; bool resutl = INV_IssueManager.UpdateINV_Issue(iNV_Issue); } catch (Exception ex) { } Response.Redirect("AdminDisplayINV_Issue.aspx"); }
private void showINV_IssueData() { INV_Issue iNV_Issue = new INV_Issue(); iNV_Issue = INV_IssueManager.GetINV_IssueByIssueID(Int32.Parse(Request.QueryString["ID"])); ddlCampusID.SelectedValue = iNV_Issue.CampusID.ToString(); ddlIssueMasterID.SelectedValue = iNV_Issue.IssueMasterID.ToString(); ddlStoreID.SelectedValue = iNV_Issue.StoreID.ToString(); txtProductionCode.Text = iNV_Issue.ProductionCode.ToString(); txtQuantity.Text = iNV_Issue.Quantity.ToString(); txtIssueDate.Text = iNV_Issue.IssueDate.ToString("dd MMM yyyy"); string txtUpdatedBy_Text = iNV_Issue.UpdatedBy.ToString(); string txtUpdatedDate_Text = iNV_Issue.UpdatedDate.ToString(); }
public bool UpdateINV_Issue(INV_Issue iNV_Issue) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateINV_Issue", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@IssueID", SqlDbType.Int).Value = iNV_Issue.IssueID; cmd.Parameters.Add("@CampusID", SqlDbType.Int).Value = iNV_Issue.CampusID; cmd.Parameters.Add("@IssueMasterID", SqlDbType.Int).Value = iNV_Issue.IssueMasterID; cmd.Parameters.Add("@StoreID", SqlDbType.Int).Value = iNV_Issue.StoreID; cmd.Parameters.Add("@ProductionCode", SqlDbType.NVarChar).Value = iNV_Issue.ProductionCode; cmd.Parameters.Add("@Quantity", SqlDbType.Decimal).Value = iNV_Issue.Quantity; cmd.Parameters.Add("@IssueDate", SqlDbType.DateTime).Value = iNV_Issue.IssueDate; cmd.Parameters.Add("@IssueCode", SqlDbType.NVarChar).Value = iNV_Issue.IssueNo; cmd.Parameters.Add("@TagID", SqlDbType.NVarChar).Value = iNV_Issue.TagID; cmd.Parameters.Add("@IteamCode", SqlDbType.Int).Value = iNV_Issue.ItemID; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = iNV_Issue.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = iNV_Issue.UpdatedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public INV_Issue GetINV_IssueFromReader(IDataReader reader) { try { INV_Issue iNV_Issue = new INV_Issue ( DataAccessObject.IsNULL<int>(reader["IssueID"]), DataAccessObject.IsNULL<int>(reader["CampusID"]), DataAccessObject.IsNULL<int>(reader["IssueMasterID"]), DataAccessObject.IsNULL<int>(reader["StoreID"]), DataAccessObject.IsNULL<string>(reader["ProductionCode"]), DataAccessObject.IsNULL<decimal>(reader["Quantity"]), DataAccessObject.IsNULL<DateTime>(reader["IssueDate"]), DataAccessObject.IsNULL<string>(reader["IssueCode"]), DataAccessObject.IsNULL<string>(reader["TagID"]), DataAccessObject.IsNULL<int>(reader["IteamCode"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdatedDate"]) ); return iNV_Issue; } catch (Exception ex) { return null; } }
public static INV_Issue GetSTD_CampusByCampusID(int CampusID) { INV_Issue iNV_Issue = new INV_Issue(); SqlINV_IssueProvider sqlINV_IssueProvider = new SqlINV_IssueProvider(); iNV_Issue = sqlINV_IssueProvider.GetINV_IssueByCampusID(CampusID); return iNV_Issue; }
public static INV_Issue GetINV_StoreByStoreID(int StoreID) { INV_Issue iNV_Issue = new INV_Issue(); SqlINV_IssueProvider sqlINV_IssueProvider = new SqlINV_IssueProvider(); iNV_Issue = sqlINV_IssueProvider.GetINV_IssueByStoreID(StoreID); return iNV_Issue; }
public static bool UpdateINV_Issue(INV_Issue iNV_Issue) { SqlINV_IssueProvider sqlINV_IssueProvider = new SqlINV_IssueProvider(); return sqlINV_IssueProvider.UpdateINV_Issue(iNV_Issue); }
public static int InsertINV_Issue(INV_Issue iNV_Issue) { SqlINV_IssueProvider sqlINV_IssueProvider = new SqlINV_IssueProvider(); return sqlINV_IssueProvider.InsertINV_Issue(iNV_Issue); }
protected void LinkFinalUpdate_Click(object sender, EventArgs e) { if (ddlStoreFromID.Text == "Select Store" || txtIssueNo.Text == "") { lblMessage.Text = "Enter Infomation Currectly"; return; } lblMessage.Text = ""; string comcod = "1101"; string issueno = this.txtIssueNo.Text; string storeid = this.ddlStoreFromID.SelectedValue; string masterName = this.txtRemark.Text; string proqty = "0"; if (hdnTotalQnty.Value != string.Empty) { proqty = hdnTotalQnty.Value; } string issuedate = txtIssueDate.Text.Trim(); string CampusId = this.ddlCampus.SelectedValue.ToString(); int IssueMasID = INV_MRRInfoManager.InsertIssueMaster("INV_InsertIssueMaster", issueno, storeid, masterName, proqty, issuedate, CampusId); string IssueMasterId = IssueMasID.ToString(); //---------------------------- //string comcod = "1101"; DataTable dt = (DataTable)Session["Issueitem"]; string issdate1 = txtIssueDate.Text.Trim(); for (int i = 0; i < dt.Rows.Count; i++) { //string issueno = dt.Rows[i]["issueno"].ToString().Trim(); //string itemcod = dt.Rows[i]["itemcode"].ToString().Trim(); //string itemqty = dt.Rows[i]["qty"].ToString().Trim(); //string tagid = dt.Rows[i]["tagid"].ToString().Trim(); INV_Issue issue = new INV_Issue(); issue.IssueMasterID = IssueMasID; issue.IssueNo = dt.Rows[i]["issueNo"].ToString().Trim(); issue.StoreID = Convert.ToInt32( dt.Rows[i]["storeID"].ToString().Trim()); issue.ItemID = Convert.ToInt32(dt.Rows[i]["itemcode"].ToString().Trim()); issue.Quantity = Convert.ToDecimal( dt.Rows[i]["qty"].ToString().Trim()); issue.TagID = dt.Rows[i]["tagid"].ToString().Trim(); issue.IssueDate =Convert.ToDateTime( issuedate); issue.ProductionCode = "0"; issue.AddedBy = Profile.card_id; issue.AddedDate = DateTime.Now; //int result = INV_MRRInfoManager.InsertIssueDetails("InsertINV_IssueDetail", CampusId, IssueMasterId, storeid, issueno, itemcod, tagid, itemqty, issdate1); int result = INV_IssueManager.InsertINV_Issue(issue); if (result != null) lblFinalMessage.Text = "Saved Successfully"; else lblFinalMessage.Text = "Saving Failed"; } this.txtIssueDate.Enabled = true; ((LinkButton)this.gvIssue.FooterRow.FindControl("LinkFinalUpdate")).Enabled = false; this.lnkbtnSubmitItem.Enabled = false; }