public static Msg GetUnDesignedPlan() { Msg msg = null; try { List <Tbl_Plan> lPlans = new List <Tbl_Plan>(); using (var en = new LingYunEntities()) { lPlans = en.Tbl_Plan.OrderByDescending(a => a.PlanID).ToList(); } if (lPlans.Count > 0) { msg = new Msg(true) { UserData = lPlans }; } else { msg = new Msg(false) { Message = "您当前没有要编辑的项目" }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
/// <summary> /// 更新入库批次表 /// </summary> /// <param name="matriesId"></param> /// <param name="count"></param> /// <param name="oStorage">仓储表</param> /// <returns></returns> public static Msg UpdateInBunch(int matriesId, int count, Tbl_CenterStorage oStorage) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_OutProductBatch oProduct = en.Tbl_OutProductBatch.Where(a => a.BuildBatchID == matriesId).FirstOrDefault(); oProduct.NowAdmStatus = 128; oProduct.NowAdmTime = DateTime.Now; ////Tbl_CenterStorageBatch oCenter = en.Tbl_CenterStorageBatch.Where(a => a.BuildBatchID == matriesId).FirstOrDefault(); ////oCenter.Count = count; ////oCenter.NowAdmStatus = 128; //oCenter.NowAdmTime = DateTime.Now; //en.AddToTbl_CenterStorage(oStorage); en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg() { Status = false, Message = ex.Message }; } return(msg); }
/// <summary> ///新查询确认出库批次 /// </summary> /// <returns></returns> public static Msg NQueryEnsureOutBunch(int iPlanId) { Msg msg = null; try { using (var en = new LingYunEntities()) { List <Tbl_OutCenterStorage> lStorage = en.Tbl_OutCenterStorage.Where(a => a.PlanID == iPlanId && a.PreAdmStatus != 128).ToList(); if (lStorage.Count > 0) { msg = new Msg(true) { UserData = lStorage }; } else { msg = new Msg(false) { Message = "您当前没有待出库的记录" } }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
/// <summary> /// 安卓端用户登录验证 /// </summary> /// <param name="username"></param> /// <param name="encodePsd"></param> /// <returns></returns> public static Msg Login(string Imei) { Msg loginMsg = new Msg(); List <Tbl_User> userInfo = null; try { using (var en = new LingYunEntities()) { userInfo = en.Tbl_User.Where(a => a.APP == Imei).ToList(); if (userInfo != null && userInfo.Count > 0) { loginMsg = new Msg(true) { UserData = userInfo }; } else { loginMsg = new Msg() { Status = false, Message = "请先登录" }; } } } catch (Exception ex) { loginMsg = new Msg { Message = ex.Message }; } return(loginMsg); }
/// <summary> /// 更新出库批次表 /// </summary> /// <returns></returns> public static Msg UpdateOutBunch(int BuildBunchId, int count) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_OutCenterStorage oBunch = en.Tbl_OutCenterStorage.Where(a => a.BuildBatchID == BuildBunchId).FirstOrDefault(); if (oBunch != null) { oBunch.Count = count; } en.SaveChanges(); } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
//创建人:梁林 //时间:3/29 /// <summary> ///查看所有项目 /// </summary> /// <param name="oPlan">项目表对象</param> /// <returns>消息传输实体</returns> public static Msg ShowAllPlan() { Msg msg = null; List <Tbl_Plan> lPlans = new List <Tbl_Plan>();; try { using (var en = new LingYunEntities()) { lPlans = en.Tbl_Plan.OrderByDescending(a => a.PlanID).ToList(); } msg = new Msg() { UserData = lPlans, Status = true }; } catch (Exception ex) { msg = new Msg() { Status = false, Message = ex.Message }; } return(msg); }
public static Msg QyeryPlanById(int iPlanId) { Msg msg = null; Tbl_Plan oUsers = new Tbl_Plan();; try { using (var en = new LingYunEntities()) { oUsers = en.Tbl_Plan.Where(a => a.PlanID == iPlanId).FirstOrDefault(); } msg = new Msg() { UserData = oUsers, Status = true }; } catch (Exception ex) { msg = new Msg() { Status = false, Message = ex.Message }; } return(msg); }
/// <summary> /// android端确认 /// </summary> /// <param name="oMatries"></param> /// <returns></returns> public static Msg AndroidEnsure(int iPlanid) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_Materies obj = en.Tbl_Materies.Where(a => a.MateriesID == iPlanid).FirstOrDefault(); obj.NowAdmStatus = 128; obj.NowDate = DateTime.Now.ToString(); Tbl_Plan oPlan = en.Tbl_Plan.Where(b => b.PlanID == obj.PlanID).FirstOrDefault(); if (oPlan != null) { oPlan.DesignAdmStatus = 128; } en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg UpdateMateries(Tbl_Materies oMatries) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_Materies obj = en.Tbl_Materies.Where(a => a.PlanID == oMatries.PlanID).FirstOrDefault(); obj.Date = oMatries.Date; obj.BuildNum = oMatries.BuildNum; obj.BuildName = oMatries.BuildName; obj.NowAdmStatus = oMatries.NowAdmStatus; obj.TotalNum = oMatries.TotalNum; obj.MateriesType = oMatries.MateriesType; obj.ProcessingNum = oMatries.ProcessingNum; en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg QueryProject(int iPlanId) { Msg msg = null; List <Tbl_Materies> lMetries = new List <Tbl_Materies>(); try { using (var en = new LingYunEntities()) { lMetries = en.Tbl_Materies.Where(a => a.PlanID == iPlanId).OrderByDescending(a => a.Date).ToList(); } if (lMetries != null) { msg = new Msg(true) { UserData = lMetries }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg GetMatriesCount(int iMatriesId) { Msg msg = null; Tbl_Materies oMetries = new Tbl_Materies(); try { using (var en = new LingYunEntities()) { oMetries = en.Tbl_Materies.Where(a => a.MateriesID == iMatriesId).FirstOrDefault(); } if (oMetries != null) { msg = new Msg(true) { UserData = oMetries }; } else { msg = new Msg(false) { Message = "未找到记录数" }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg AddMateries(List <Tbl_Materies> oMatries) { Msg msg = null; try { using (var en = new LingYunEntities()) { foreach (Tbl_Materies ma in oMatries) { en.AddToTbl_Materies(ma); } en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg GetMetriesByMatriesId(int iPlanId) { Msg msg = null; try { List <Tbl_Materies> oMetries = new List <Tbl_Materies>(); using (var en = new LingYunEntities()) { oMetries = en.Tbl_Materies.Where(a => a.PlanID == iPlanId).Where(a => a.NowAdmStatus != 128).ToList(); } if (oMetries != null) { msg = new Msg(true) { UserData = oMetries }; } else { msg = new Msg(false) { Message = "查找失败" }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg GetMetriesByPlanId(int iPlanId) { Msg msg = null; try { Tbl_Plan oMetries = new Tbl_Plan(); using (var en = new LingYunEntities()) { oMetries = en.Tbl_Plan.Where(a => a.PlanID == iPlanId).FirstOrDefault(); } if (oMetries != null) { msg = new Msg(true) { UserData = oMetries }; } else { msg = new Msg(false) { Message = "查找失败" }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg GetMatriesByName(string Name) { Msg msg = null; using (var en = new LingYunEntities()) { List <Tbl_InMaries> list = en.Tbl_InMaries.Where(a => a.TableName == Name).ToList(); if (list.Count > 0) { msg = new Msg(true) { UserData = list } } ; else { msg = new Msg(false) { Message = "没有找到记录" } }; } return(msg); } }
public static Msg EnsureMateries(Tbl_Materies oMatries) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_Materies obj = en.Tbl_Materies.Where(a => a.PlanID == oMatries.PlanID).FirstOrDefault(); obj.Date = oMatries.Date; obj.BuildNum = oMatries.BuildNum; obj.BuildName = oMatries.BuildName; obj.NowAdmStatus = oMatries.NowAdmStatus; obj.TotalNum = oMatries.TotalNum; obj.MateriesType = oMatries.MateriesType; obj.NowDate = DateTime.Now.ToString(); obj.ProcessingNum = oMatries.ProcessingNum; Tbl_Plan oPlan = en.Tbl_Plan.Where(b => b.PlanID == oMatries.PlanID).FirstOrDefault(); if (oPlan != null) { oPlan.DesignAdmStatus = 128; } en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg QueryBatchId(string sBarcode) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_BarCodeBatch oBarcode = en.Tbl_BarCodeBatch.Where(a => a.BarCodeNo == sBarcode).FirstOrDefault(); if (oBarcode != null) { msg = new Msg(true) { UserData = oBarcode }; } else { msg = new Msg(false) { Message = "没有找到条码信息" }; } } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
/// <summary> /// 根据编号查询入库批次表 /// </summary> /// <returns></returns> public static Msg EnsureInBunch(int iBuildBunch, Tbl_SiteStorage oStorage) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_OutCenterStorage oCenterBunch = en.Tbl_OutCenterStorage.Where(a => a.BuildBatchID == iBuildBunch).FirstOrDefault(); if (oCenterBunch != null) { oCenterBunch.NowAdmStatus = 128; oCenterBunch.NowAdmTime = DateTime.Now; } Tbl_SiteStorageBatch oSiteInBunch = en.Tbl_SiteStorageBatch.Where(a => a.BuildBatchID == iBuildBunch).FirstOrDefault(); if (oCenterBunch != null) { oSiteInBunch.NowAdmStatus = 128; oCenterBunch.NowAdmTime = DateTime.Now; } en.Tbl_SiteStorage.AddObject(oStorage); en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
//创建人:梁林 //时间:3/29 /// <summary> ///向项目汇总表增加一条项目 /// </summary> /// <param name="oPlan">项目表对象</param> /// <returns>消息传输实体</returns> public static Msg AddPlan(Tbl_Plan oPlan) { Msg msg = null; if (oPlan != null) { try { using (var en = new LingYunEntities()) { en.Tbl_Plan.AddObject(oPlan); en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg() { Status = false, Message = ex.Message }; } } return(msg); }
/// <summary> /// 确认出库批次表 /// </summary> /// <returns></returns> public static Msg EnsureOutBunch(int iBuildBunch, int count) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_SiteStorage oSiteStorage = en.Tbl_SiteStorage.Where(a => a.BuildBatchID == iBuildBunch).FirstOrDefault(); if (oSiteStorage != null) { oSiteStorage.NowAdmStatus = 128; oSiteStorage.NowAdmTime = DateTime.Now; } Tbl_OutSiteStorage oSiteBunch = en.Tbl_OutSiteStorage.Where(a => a.BuildBatchID == iBuildBunch).FirstOrDefault(); if (oSiteStorage != null) { oSiteBunch.PreAdmStatus = 128; oSiteBunch.PreAdmTime = DateTime.Now; oSiteBunch.Count = count; } en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg GetAllUser() { Msg msg = null; List <Tbl_User> userInfo = null; try { using (var en = new LingYunEntities()) { userInfo = en.Tbl_User.ToList(); } msg = new Msg() { Status = true, UserData = userInfo }; } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
/// <summary> ///查询出库批次 /// </summary> /// <returns></returns> public static Msg QueryOutBunch() { Msg msg = null; try { using (var en = new LingYunEntities()) { List <Tbl_SiteStorage> lStorage = en.Tbl_SiteStorage.Where(a => a.PreAdmStatus == 128 && a.NowAdmStatus == 1).ToList(); if (lStorage.Count > 0) { msg = new Msg(true) { UserData = lStorage }; } else { msg = new Msg(false) { Message = "您当前没有待出库的记录" } }; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg QueryWaitInBunch() { Msg msg = null; try { using (var en = new LingYunEntities()) { List <Tbl_CenterStorageBatch> lBunch = en.Tbl_CenterStorageBatch.Where(a => a.PreAdmStatus == 128 && a.NowAdmStatus == 1).ToList(); if (lBunch != null) { msg = new Msg(true) { UserData = lBunch }; } else { msg = new Msg(false) { Message = "您当前没有待确认的入库批次记录" }; } } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg AndroidOutBatch(int iBatchid) { Msg msg = null; try { using (var en = new LingYunEntities()) { var obj = en.Tbl_SiteStorage.Where(a => a.BuildBatchID == iBatchid).FirstOrDefault(); obj.NowAdmStatus = 128; obj.NowAdmTime = DateTime.Now; var oOut = en.Tbl_OutSiteStorage.Where(a => a.BuildBatchID == iBatchid).FirstOrDefault(); oOut.PreAdmStatus = 128; oOut.PreAdmTime = DateTime.Now; en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false); } return(msg); }
/// <summary> ///新插入出库批次表 /// </summary> /// <returns></returns> public static Msg NEditOutBunch(List <Tbl_OutCenterStorage> list) { Msg msg = null; try { using (var en = new LingYunEntities()) { foreach (Tbl_OutCenterStorage obj in list) { en.Tbl_OutCenterStorage.AddObject(obj); } en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg GetUnsure() { Msg msg = null; try { using (var en = new LingYunEntities()) { List <Tbl_Materies> lMateries = en.Tbl_Materies.OrderByDescending((b => b.Date)).ToList(); if (lMateries.Count > 0) { msg = new Msg(true) { UserData = lMateries }; } else { msg = new Msg(false); } } } catch (Exception ex) { msg = new Msg(false); } return(msg); }
public static Msg EnsureInBunch(Tbl_CenterStorageBatch oBunch, Tbl_CenterStorage oStorage) { Msg msg = null; if (oBunch != null) { try { using (var en = new LingYunEntities()) { var obj = en.Tbl_OutProductBatch.Where(a => a.BuildBatchID == oBunch.BuildBatchID).FirstOrDefault(); obj.NowAdmStatus = 128; en.Tbl_CenterStorageBatch.AddObject(oBunch); en.SaveChanges(); } } catch (Exception ex) { msg = new Msg() { Status = false, Message = ex.Message }; } } return(msg); }
/// <summary> /// 获取未完成的项目 /// </summary> /// <returns></returns> public static Msg GetUnFillPlans() { Msg msg = null; try { using (var en = new LingYunEntities()) { List <Tbl_Plan> lPlans = en.Tbl_Plan.OrderByDescending(a => a.PlanID).ToList();//没有领料完 if (lPlans.Count > 0) { msg = new Msg(true) { UserData = lPlans }; } else { msg = new Msg(false) { Message = "未查找到记录" }; } } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
/// <summary> /// 根据编号查询入库批次表 /// </summary> /// <returns></returns> public static Msg QueryStorageById(int BuildBunchId) { Msg msg = null; try { using (var en = new LingYunEntities()) { Tbl_CenterStorage lBunch = en.Tbl_CenterStorage.Where(a => a.BuildBatchID == BuildBunchId).FirstOrDefault(); if (lBunch != null) { msg = new Msg(true) { UserData = lBunch }; } else { msg = new Msg(false) { Message = "您当前没有待确认的入库批次记录" }; } } } catch (Exception ex) { msg = new Msg(false) { Message = ex.Message }; } return(msg); }
public static Msg EditOutBunch(Tbl_OutProductBatch oBunch) { Msg msg = null; if (oBunch != null) { try { using (var en = new LingYunEntities()) { Tbl_OutProductBatch obj = en.Tbl_OutProductBatch.Where(a => a.PlanID == oBunch.PlanID && oBunch.MateriesID == a.MateriesID).FirstOrDefault(); if (obj == null) { en.Tbl_OutProductBatch.AddObject(oBunch); } else { obj.Count = oBunch.Count; } en.SaveChanges(); msg = Msg.Default; } } catch (Exception ex) { msg = new Msg() { Status = false, Message = ex.Message }; } } return(msg); }