public bool SavePoToRequest(RequestSupplyChain requestSupply, int userId) { bool result = false; try { accessManager.SqlConnectionOpen(DataBase.DataEntryTracker); foreach (LoadPoCatagory loadPocatagory in requestSupply.LoadPoCatagories) { List <SqlParameter> aprap = new List <SqlParameter>(); aprap.Add(new SqlParameter("@RequestId", requestSupply.RequestID)); aprap.Add(new SqlParameter("@PoName", loadPocatagory.PoCatagoryName)); aprap.Add(new SqlParameter("@UserId", userId)); result = accessManager.SaveData("sp_SavePoToRequest", aprap); } return(result); } catch (Exception exception) { accessManager.SqlConnectionClose(true); throw exception; } finally { accessManager.SqlConnectionClose(); } }
public ActionResult SavePoAginistRequest(RequestSupplyChain requestSupplyChain) { if (Session["TrackerUserId"] == null) { return(RedirectToAction("Index", "Account")); } int userid = Convert.ToInt32(Session["TrackerUserId"]); return(Json(supplyChain.SavePoToRequest(requestSupplyChain, userid), JsonRequestBehavior.AllowGet)); }
public RequestSupplyChain GetDetailsRequestSupply(int UserId, int RequstId) { RequestSupplyChain resupply = new RequestSupplyChain(); try { accessManager.SqlConnectionOpen(DataBase.DataEntryTracker); List <SqlParameter> aParameters = new List <SqlParameter>(); aParameters.Add(new SqlParameter("@SupplyChainId", RequstId)); SqlDataReader dr = accessManager.GetSqlDataReader("sp_MerchandDetailsSupply", aParameters); while (dr.Read()) { resupply.SupplyChainId = (int)dr["SupplyChainId"]; resupply.CreateTime = dr["CreateTime"].ToString(); resupply.AssignTime = dr["AssignTime"].ToString(); resupply.StartTime = dr["StartTime"].ToString(); resupply.EndTime = dr["EndTime"].ToString(); resupply.OttDate = dr["OttDate"].ToString(); resupply.PoCatagoryName = dr["PoCatagoryName"].ToString(); resupply.CoordinatorName = dr["CoordinatorName"].ToString(); resupply.SpUserName = dr["DataEntryName"].ToString(); resupply.Remarks = dr["Remarks"].ToString(); resupply.Progressid = (int)dr["ProgressState"]; resupply.PoNumber = dr["PONumber"].ToString(); } resupply.fileUploadModel = new List <FileUploadModel>(); resupply.fileUploadModel = GetFilesByRivisionRequest(RequstId); return(resupply); } catch (Exception e) { accessManager.SqlConnectionClose(true); throw e; } finally { accessManager.SqlConnectionClose(); } }
public List <RequestSupplyChain> GetSupplyChainRequest(int userId, int Progress, int UserType) { List <RequestSupplyChain> requestList = new List <RequestSupplyChain>(); try { accessManager.SqlConnectionOpen(DataBase.DataEntryTracker); List <SqlParameter> aParameters = new List <SqlParameter>(); aParameters.Add(new SqlParameter("@userId", userId)); aParameters.Add(new SqlParameter("@Progress", Progress)); aParameters.Add(new SqlParameter("@UserType", UserType)); SqlDataReader dr = accessManager.GetSqlDataReader("sp_GetAllSupplyChainRequest", aParameters); while (dr.Read()) { RequestSupplyChain request = new RequestSupplyChain(); request.SupplyChainId = (int)dr["SupplyChainId"]; request.CreateTime = dr["CreateTime"].ToString(); request.BuyerName = dr["BuyerName"].ToString(); request.PoNumber = dr["PONumber"].ToString(); request.StyleName = dr["StyleName"].ToString(); request.ProgressState = dr["Progress"].ToString(); request.Progressid = (int)dr["ProgressState"]; request.RequestBy = dr["RequestBy"].ToString(); request.OttDate = dr["OttDate"].ToString(); requestList.Add(request); } return(requestList); } catch (Exception e) { accessManager.SqlConnectionClose(true); throw e; } finally { accessManager.SqlConnectionClose(); } }