protected void Grid1_OnRebind(object sender, EventArgs e) { iPartConsumptionClient objService = new iPartConsumptionClient(); try { Grid1.DataSource = null; Grid1.DataBind(); CustomProfile profile = CustomProfile.GetProfile(); HiddenField hdn = (HiddenField)UCProductSearch1.FindControl("hdnProductSearchSelectedRec"); List <POR_SP_GetPartDetails_OfConsumption_Result> PartList = new List <POR_SP_GetPartDetails_OfConsumption_Result>(); if (hdn.Value == "") { PartList = objService.GetExistingTempDataBySessionIDObjectName(Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr).ToList(); } else if (hdn.Value != "") { PartList = objService.AddPartIntoConsumption_TempDataByPartIDs(hdn.Value, Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, Convert.ToInt32(ddlSites.SelectedItem.Value), profile.DBConnection._constr).ToList(); } Grid1.DataSource = PartList; Grid1.DataBind(); } catch { } finally { objService.Close(); } }
protected void GetConsuptionHead() { iPartConsumptionClient objService = new iPartConsumptionClient(); PORtConsumptionHead ConsuptionHead = new PORtConsumptionHead(); try { CustomProfile profile = CustomProfile.GetProfile(); ConsuptionHead = objService.GetConsumptionHeadByConsumptionID(Convert.ToInt64(HttpContext.Current.Session["PORConsumptionID"].ToString()), profile.DBConnection._constr); ddlSites.SelectedIndex = ddlSites.Items.IndexOf(ddlSites.Items.FindByValue(ConsuptionHead.SiteID.ToString())); UC_DateConsumption.Date = ConsuptionHead.ConsumptionDate; ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(ConsuptionHead.StatusID.ToString())); ddlConsumedBy.DataSource = WMFillUserList(Convert.ToInt64(ConsuptionHead.SiteID)); ddlConsumedBy.DataBind(); ddlConsumedBy.SelectedIndex = ddlConsumedBy.Items.IndexOf(ddlConsumedBy.Items.FindByValue(ConsuptionHead.ConsumedByUserID.ToString())); txtRemark.Text = ConsuptionHead.Remark; ddlContainer.DataSource = WMFillEnginList(Convert.ToInt64(ConsuptionHead.SiteID)); ddlContainer.DataBind(); ddlContainer.SelectedIndex = ddlContainer.Items.IndexOf(ddlContainer.Items.FindByText(ConsuptionHead.Container.ToString())); lblEngineModel.Text = ConsuptionHead.EngineModel; lblEngineSerial.Text = ConsuptionHead.EngineSerial; txtFailureHours.Text = ConsuptionHead.FailureHours; txtFailureCause.Text = ConsuptionHead.FailureCause; txtFailureNature.Text = ConsuptionHead.FailureNature; FillPartDetailByConsumptionID(ConsuptionHead.ConH_ID); divDisabled(); } catch { } finally { objService.Close(); } }
public List <PORServicePartConsumption.mStatu> FillStatus() { string state = HttpContext.Current.Session["PORstate"].ToString(); iPartConsumptionClient objService = new iPartConsumptionClient(); List <PORServicePartConsumption.mStatu> StatusList = new List <PORServicePartConsumption.mStatu>(); try { CustomProfile profile = CustomProfile.GetProfile(); StatusList = objService.GetStatusListForConsumption("All,Consumption", state, profile.Personal.UserID, profile.DBConnection._constr).ToList(); PORServicePartConsumption.mStatu select = new PORServicePartConsumption.mStatu() { ID = 0, Status = "-Select-" }; StatusList.Insert(0, select); ddlStatus.DataSource = null; ddlStatus.DataBind(); ddlStatus.DataSource = StatusList; ddlStatus.DataBind(); ddlStatus.SelectedIndex = 1; } catch { } finally { objService.Close(); } return(StatusList); }
protected void FillGVRequest(string FillBy) { iPartConsumptionClient objServie = new iPartConsumptionClient(); try { CustomProfile profile = CustomProfile.GetProfile(); GVConsumption.DataSource = null; GVConsumption.DataBind(); if (FillBy == "UserID") { GVConsumption.DataSource = objServie.GetConsumptionSummayByUserID(profile.Personal.UserID, profile.DBConnection._constr); } else if (FillBy == "SiteID") { //GVConsumption.DataSource = objServie.GetConsumptionSummayByUserID(Session["SiteIDs"].ToString(), profile.DBConnection._constr); } else if (FillBy == "RequestID") { //GVConsumption.DataSource = objServie.GetConsumptionSummayByUserID(Convert.ToInt64(Session["PORRequestID"].ToString()), profile.DBConnection._constr); } else if (FillBy == "ReceiptID") { GVConsumption.DataSource = objServie.GetConsumptionSummayByReceiptIDs(Session["PORReceiptID"].ToString(), profile.DBConnection._constr); } GVConsumption.DataBind(); } catch { } finally { objServie.Close(); } }
public static void WMRemovePartFromList(Int32 Sequence) { iPartConsumptionClient objService = new iPartConsumptionClient(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); CustomProfile profile = CustomProfile.GetProfile(); objService.RemovePartFrom_TempData(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, Sequence, profile.DBConnection._constr); } catch { } finally { objService.Close(); } }
public static void WMpageAddNew() { iPartConsumptionClient objService = new iPartConsumptionClient(); try { CustomProfile profile = CustomProfile.GetProfile(); HttpContext.Current.Session["PORConsumptionID"] = "0"; HttpContext.Current.Session["PORstate"] = "Add"; objService.ClearTempDataFromDB(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr); } catch { } finally { objService.Close(); } }
protected void FillPartDetailByReceiptID(long ReceiptID) { iPartConsumptionClient objService = new iPartConsumptionClient(); try { CustomProfile profile = CustomProfile.GetProfile(); Grid1.DataSource = null; Grid1.DataBind(); Grid1.DataSource = objService.GetConsumptionPartDetailByReceiptID(ReceiptID, Convert.ToInt64(ddlSites.SelectedItem.Value), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr); Grid1.DataBind(); } catch { } finally { objService.Close(); } }
public static string WMUpdateQty(object objConsumed) { string RemaningQty = ""; iPartConsumptionClient objService = new iPartConsumptionClient(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objConsumed; CustomProfile profile = CustomProfile.GetProfile(); POR_SP_GetPartDetails_OfConsumption_Result ConsumedPart = new POR_SP_GetPartDetails_OfConsumption_Result(); ConsumedPart.Sequence = Convert.ToInt64(dictionary["Sequence"]); ConsumedPart.ConsumedQty = Convert.ToDecimal(dictionary["ConsumedQty"]); objService.UpdatePartConsumedQty_TempData(HttpContext.Current.Session.SessionID, ObjectName, profile.Personal.UserID.ToString(), ConsumedPart, profile.DBConnection._constr); } catch { } finally { objService.Close(); } return(RemaningQty); }
public static string WMSaveConsumption(object objConsumption) { string result = ""; iPartConsumptionClient objService = new iPartConsumptionClient(); try { CustomProfile profile = CustomProfile.GetProfile(); PORtConsumptionHead ConsumptionHead = new PORtConsumptionHead(); Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objConsumption; if (HttpContext.Current.Session["PORConsumptionID"] != null) { if (HttpContext.Current.Session["PORConsumptionID"].ToString() == "0") { ConsumptionHead.CreatedBy = profile.Personal.UserID; ConsumptionHead.CreationDt = DateTime.Now; } else { ConsumptionHead = objService.GetConsumptionHeadByConsumptionID(Convert.ToInt64(HttpContext.Current.Session["PORConsumptionID"]), profile.DBConnection._constr); ConsumptionHead.LastModifiedBy = profile.Personal.UserID; ConsumptionHead.LastModifiedDt = DateTime.Now; } ConsumptionHead.SiteID = Convert.ToInt64(dictionary["SiteID"]); ConsumptionHead.ReferenceID = 0; ConsumptionHead.ObjectName = "DirectConsumed"; if (HttpContext.Current.Session["PORReceiptID"] != null) { ConsumptionHead.ReferenceID = Convert.ToInt64(HttpContext.Current.Session["PORReceiptID"].ToString());; ConsumptionHead.ObjectName = "MaterialReceipt"; } ConsumptionHead.ConsumptionDate = Convert.ToDateTime(dictionary["ConsumptionDate"]); ConsumptionHead.StatusID = Convert.ToInt64(dictionary["StatusID"]); ConsumptionHead.ConsumedByUserID = Convert.ToInt64(dictionary["ConsumedByUserID"]); ConsumptionHead.Remark = dictionary["Remark"].ToString(); ConsumptionHead.FailureCause = dictionary["FailureCause"].ToString(); ConsumptionHead.FailureHours = dictionary["FailureHours"].ToString(); ConsumptionHead.FailureNature = dictionary["FailureNature"].ToString(); ConsumptionHead.EngineSerial = dictionary["EngineSerial"].ToString(); ConsumptionHead.EngineModel = dictionary["EngineModel"].ToString(); ConsumptionHead.GeneratorModel = dictionary["GeneratorModel"].ToString(); ConsumptionHead.GeneratorSerial = dictionary["GeneratorSerial"].ToString(); ConsumptionHead.TransformerSerial = dictionary["TransformerSerial"].ToString(); ConsumptionHead.Container = dictionary["Container"].ToString(); long ConsumptionID = objService.SetIntoPartConsumptionHead(ConsumptionHead, profile.DBConnection._constr); if (ConsumptionID > 0) { objService.FinalSavePartDetail(HttpContext.Current.Session.SessionID, ObjectName, ConsumptionID, profile.Personal.UserID.ToString(), profile.DBConnection._constr); result = "Consumption record saved successfully"; } } } catch { result = "Some error occurred"; } finally { objService.Close(); } return(result); }