public bool UpdateChemCloud_Dictionaries(ChemCloud_Dictionaries model) { bool result = true; ChemCloud_Dictionaries _ChemCloud_Dictionaries = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.Id == model.Id); if (_ChemCloud_Dictionaries != null) { _ChemCloud_Dictionaries.DictionaryTypeId = model.DictionaryTypeId; _ChemCloud_Dictionaries.DKey = model.DKey; _ChemCloud_Dictionaries.DValue = model.DValue; _ChemCloud_Dictionaries.DValue_En = model.DValue_En; _ChemCloud_Dictionaries.Remarks = model.Remarks; try { context.SaveChanges(); } catch (DbEntityValidationException dbEx) { result = false; } } else { result = false; } return(result); }
public ChemCloud_Dictionaries GetChemCloud_Dictionaries(long Id) { ChemCloud_Dictionaries _ChemCloud_Dictionaries = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.Id == Id); return(_ChemCloud_Dictionaries); }
public List <ChemCloud_Dictionaries> GetChemCloud_Dictionariess(ChemCloud_Dictionaries model) { IQueryable <ChemCloud_Dictionaries> ChemCloud_Dictionariess = from item in base.context.ChemCloud_Dictionaries select item; if (model.DictionaryTypeId > 0) { ChemCloud_Dictionariess = from d in ChemCloud_Dictionariess where d.DictionaryTypeId.Equals(model.DictionaryTypeId) select d; } if (!string.IsNullOrWhiteSpace(model.DKey)) { ChemCloud_Dictionariess = from d in ChemCloud_Dictionariess where d.DKey.Contains(model.DKey) select d; } if (!string.IsNullOrWhiteSpace(model.DValue)) { ChemCloud_Dictionariess = from d in ChemCloud_Dictionariess where d.DValue.Contains(model.DValue) select d; } return(ChemCloud_Dictionariess.ToList <ChemCloud_Dictionaries>()); }
public JsonResult DictionariesPageModelList(int page, int rows, string dkey = "", string dvalue_en = "", string typeid = "0") { ChemCloud_Dictionaries casewhere = new ChemCloud_Dictionaries() { PageNo = page, PageSize = rows, DKey = dkey, DictionaryTypeId = long.Parse(typeid) }; PageModel <ChemCloud_Dictionaries> listpage = ServiceHelper.Create <IChemCloud_DictionariesService>().GetPage_ChemCloud_Dictionaries(casewhere); var collection = from item in listpage.Models.ToList() select new { Id = item.Id, DictionaryTypeId = item.DictionaryTypeId, TypeName = ServiceHelper.Create <IChemCloud_DictionaryTypeService>().GetChemCloud_DictionaryType(item.DictionaryTypeId) == null ? "" : ServiceHelper.Create <IChemCloud_DictionaryTypeService>().GetChemCloud_DictionaryType(item.DictionaryTypeId).TypeName, DKey = item.DKey, DValue = item.DValue, DValue_En = item.DValue_En, Remarks = item.Remarks }; return(Json(new { rows = collection, total = listpage.Total })); }
public MessageSetting GetSetting(long Id) { MessageSetting nums = context.MessageSetting.FindById <MessageSetting>(Id); ChemCloud_Dictionaries dict = (from item in context.ChemCloud_Dictionaries where item.DValue == nums.Languagetype.ToString() && item.DictionaryTypeId == 10 select item).FirstOrDefault(); nums.LanguageName = dict.DKey; return(nums); }
public JsonResult DictionaryAddFuc(string DictionaryTypeId = "0", string DKey = "", string DValue = "", string DValue_En = "", string Remarks = "") { ChemCloud_Dictionaries model = new ChemCloud_Dictionaries(); model.DictionaryTypeId = long.Parse(DictionaryTypeId); model.DKey = DKey; model.DValue = DValue; model.DValue_En = DValue_En; model.Remarks = Remarks; bool result = ServiceHelper.Create <IChemCloud_DictionariesService>().AddChemCloud_Dictionaries(model); return(Json(new { success = result })); }
public LawInfo GetLawInfo(long Id) { LawInfo model = context.LawInfo.FindById(Id); if (model != null) { ManagerInfo manaInfo = context.ManagerInfo.FirstOrDefault((ManagerInfo m) => m.Id == model.Auditor && m.ShopId == 0); model.UserName = (manaInfo == null ? "" : manaInfo.UserName); ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 10 && m.DValue == model.LanguageType.ToString()); model.Language = dicts.DKey; } return(model); }
public bool AddChemCloud_Dictionaries(ChemCloud_Dictionaries model) { context.ChemCloud_Dictionaries.Add(model); int i = context.SaveChanges(); if (i > 0) { return(true); } else { return(false); } }
public ApplyAmountInfo GetApplyById(long Id) { ApplyAmountInfo ApplyAmount = context.ApplyAmountInfo.FirstOrDefault((ApplyAmountInfo m) => m.Id == Id); UserMemberInfo userInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(ApplyAmount.ApplyUserId)); ApplyAmount.ApplyName = (userInfo == null ? "" : userInfo.UserName); if (ApplyAmount != null) { UserMemberInfo userInfos = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(ApplyAmount.AuthorId)); ApplyAmount.AuthorName = (userInfo == null ? "" : userInfos.UserName); ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 1 && m.DValue == ApplyAmount.CoinType.ToString()); ApplyAmount.CoinName = dicts.DKey; } return(ApplyAmount); }
public PageModel <TechnicalInfo> GetTechInfos(TechnicalInfoQuery model, long?userId) { int pageNum = 0; IQueryable <TechnicalInfo> techInfo = from item in base.context.TechnicalInfo select item; if (userId.HasValue && userId.Value != 0) { techInfo = (from a in techInfo where a.PublisherId == userId.Value select a); } string begin = model.BeginTime.ToString("yyyy/MM/dd"); string end = model.EndTime.ToString("yyyy/MM/dd"); if (!string.IsNullOrWhiteSpace(begin) && !begin.Equals("0001/01/01") && !string.IsNullOrWhiteSpace(end) && !end.Equals("0001/01/01")) { techInfo = (from a in techInfo where a.PublishTime > model.BeginTime && a.PublishTime < model.EndTime select a); } if (model.Status.HasValue && model.Status != 0) { techInfo = (from a in techInfo where a.Status == model.Status select a); } if (!string.IsNullOrWhiteSpace(model.Title)) { techInfo = (from a in techInfo where a.Title.Contains(model.Title) select a); } techInfo = techInfo.GetPage(out pageNum, model.PageNo, model.PageSize, (IQueryable <TechnicalInfo> d) => from o in d orderby o.PublishTime descending select o); foreach (TechnicalInfo list in techInfo.ToList()) { if (list != null) { UserMemberInfo userInfo = context.UserMemberInfo.FindById(list.PublisherId); list.PublisherName = (userInfo == null ? "" : userInfo.UserName); ManagerInfo manaInfo = context.ManagerInfo.FirstOrDefault((ManagerInfo m) => m.Id == list.Auditor && m.ShopId == 0); list.AuditorName = (manaInfo == null ? "" : manaInfo.UserName); ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 10 && m.DValue == list.LanguageType.ToString()); list.Language = dicts == null ? "" : dicts.DKey; } } return(new PageModel <TechnicalInfo> { Models = techInfo, Total = pageNum }); }
public ActionResult DictionariesEdit(long Id) { ChemCloud_DictionaryType query = new ChemCloud_DictionaryType() { IsEnabled = "1" }; List <ChemCloud_DictionaryType> typelist = ServiceHelper.Create <IChemCloud_DictionaryTypeService>().GetChemCloud_DictionaryTypes(query); ViewBag.typelist = typelist; ChemCloud_Dictionaries _ChemCloud_Dictionaries = ServiceHelper.Create <IChemCloud_DictionariesService>().GetChemCloud_Dictionaries(Id); return(View(_ChemCloud_Dictionaries)); }
public List <LimitedAmount> GetLimitedAmountByRoleId(long roleId) { List <LimitedAmount> limitedLists = new List <LimitedAmount>(); IQueryable <LimitedAmount> Limited = from item in context.LimitedAmount where item.RoleId == roleId select item; foreach (LimitedAmount list in Limited.ToList()) { UserMemberInfo userInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id == list.RoleId); ChemCloud_Dictionaries dictInfo = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DValue == list.CoinType.ToString() && m.DictionaryTypeId == 1); list.CoinTypeName = (dictInfo == null ? "" : dictInfo.DKey); limitedLists.Add(list); } return(limitedLists); }
public PageModel <MargainBill> GetBill(BargainBillQuery billQueryModel) { int num; IQueryable <MargainBill> billsByQueryModel = GetbillsByQueryModel(billQueryModel, out num); foreach (MargainBill list in billsByQueryModel.ToList()) { UserMemberInfo memberInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(list.ShopId)); list.ShopName = (memberInfo == null ? "" : memberInfo.UserName); ChemCloud_Dictionaries dictionaryInfo = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 1 && m.DValue == list.CoinType.ToString()); list.CoinTypeName = (dictionaryInfo == null ? "" : dictionaryInfo.DKey); } return(new PageModel <MargainBill>() { Models = billsByQueryModel, Total = num }); }
public bool DeleteChemCloud_Dictionaries(long Id) { int i = 0; ChemCloud_Dictionaries _ChemCloud_Dictionaries = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.Id == Id); if (_ChemCloud_Dictionaries != null) { context.ChemCloud_Dictionaries.Remove(_ChemCloud_Dictionaries); i = context.SaveChanges(); } if (i > 0) { return(true); } else { return(false); } }
public PageModel <ChemCloud_Dictionaries> GetPage_ChemCloud_Dictionaries(ChemCloud_Dictionaries model) { IQueryable <ChemCloud_Dictionaries> ChemCloud_Dictionariess = from item in base.context.ChemCloud_Dictionaries select item; if (model.DictionaryTypeId > 0) { ChemCloud_Dictionariess = from d in ChemCloud_Dictionariess where d.DictionaryTypeId.Equals(model.DictionaryTypeId) select d; } if (!string.IsNullOrWhiteSpace(model.DKey)) { ChemCloud_Dictionariess = from d in ChemCloud_Dictionariess where d.DKey.Contains(model.DKey) select d; } if (!string.IsNullOrWhiteSpace(model.DValue)) { ChemCloud_Dictionariess = from d in ChemCloud_Dictionariess where d.DValue.Contains(model.DValue) select d; } Func <IQueryable <ChemCloud_Dictionaries>, IOrderedQueryable <ChemCloud_Dictionaries> > func = null; func = (IQueryable <ChemCloud_Dictionaries> d) => from o in d orderby o.DictionaryTypeId descending select o; int num = ChemCloud_Dictionariess.Count(); ChemCloud_Dictionariess = ChemCloud_Dictionariess.GetPage(out num, model.PageNo, model.PageSize, func); return(new PageModel <ChemCloud_Dictionaries>() { Models = ChemCloud_Dictionariess, Total = num }); }
public PageModel <LawInfo> GetLawInfos(LawInfoQuery model, long?userId) { int pageNum = 0; IQueryable <LawInfo> lawInfo = from item in base.context.LawInfo select item; string begin = model.BeginTime.ToString("yyyy/MM/dd"); string end = model.EndTime.ToString("yyyy/MM/dd"); if (!string.IsNullOrWhiteSpace(begin) && !begin.Equals("0001/01/01") && !string.IsNullOrWhiteSpace(end) && !end.Equals("0001/01/01")) { lawInfo = (from a in lawInfo where a.CreateTime > model.BeginTime && a.CreateTime < model.EndTime select a); } if (!string.IsNullOrWhiteSpace(model.Title)) { lawInfo = (from a in lawInfo where a.Title.Contains(model.Title) select a); } lawInfo = lawInfo.GetPage(out pageNum, model.PageNo, model.PageSize, (IQueryable <LawInfo> d) => from o in d orderby o.CreateTime descending select o); foreach (LawInfo list in lawInfo.ToList()) { if (list.UserId != 0) { ManagerInfo manaInfo = context.ManagerInfo.FirstOrDefault((ManagerInfo m) => m.Id == list.Auditor && m.ShopId == 0); list.UserName = (manaInfo == null ? "" : manaInfo.UserName); ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 10 && m.DValue == list.LanguageType.ToString()); list.Language = dicts.DKey; } } return(new PageModel <LawInfo> { Models = lawInfo, Total = pageNum }); }
/// <summary> /// 限额申请列表 /// </summary> /// <param name="Status">申请状态</param> /// <param name="Start_datetime">开始时间</param> /// <param name="End_datetime">结束时间</param> /// <param name="page"></param> /// <param name="rows"></param> /// <param name="userId">当前用户</param> /// <param name="Applicant">申请人(0:子账户申请;1:我的申请)</param> /// <returns></returns> public PageModel <ApplyAmountInfo> GetApplyAmounts(int?Status, DateTime?Start_datetime, DateTime?End_datetime, int page, int rows, long userId, int Applicant) { PageModel <ApplyAmountInfo> res = new PageModel <ApplyAmountInfo>(); IQueryable <ApplyAmountInfo> GetApplyAmounts = from item in base.context.ApplyAmountInfo //where item.AuthorId == userId select item; if (Applicant == 0) { GetApplyAmounts = from d in GetApplyAmounts where d.AuthorId == userId select d; } else { GetApplyAmounts = from d in GetApplyAmounts where d.ApplyUserId == userId select d; } if (Status.HasValue && Status.Value != 3) { GetApplyAmounts = from d in GetApplyAmounts where (int)d.ApplyStatus == Status.Value select d; } if (Start_datetime != null && End_datetime != null) { End_datetime = Convert.ToDateTime(End_datetime).AddDays(1).AddMilliseconds(-1); GetApplyAmounts = GetApplyAmounts.Where(x => x.ApplyDate >= Start_datetime && x.ApplyDate <= End_datetime).OrderByDescending(x => x.ApplyDate); } else if (Start_datetime != null) { GetApplyAmounts = GetApplyAmounts.Where(x => x.ApplyDate >= Start_datetime).OrderByDescending(x => x.ApplyDate); } else if (End_datetime != null) { End_datetime = Convert.ToDateTime(End_datetime).AddDays(1).AddMilliseconds(-1); GetApplyAmounts = GetApplyAmounts.Where(x => x.ApplyDate <= End_datetime).OrderByDescending(x => x.ApplyDate); } Func <IQueryable <ApplyAmountInfo>, IOrderedQueryable <ApplyAmountInfo> > func = null; func = (IQueryable <ApplyAmountInfo> d) => from o in d orderby o.ApplyStatus ascending select o; int num = GetApplyAmounts.Count(); GetApplyAmounts = GetApplyAmounts.GetPage(out num, page, rows, func); foreach (ApplyAmountInfo list in GetApplyAmounts.ToList()) { UserMemberInfo userInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(list.ApplyUserId)); list.ApplyName = (userInfo == null ? "" : userInfo.UserName); if (list.AuthorId != 0) { UserMemberInfo userInfos = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(list.AuthorId)); list.AuthorName = (userInfo == null ? "" : userInfos.UserName); ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 1 && m.DValue == list.CoinType.ToString()); list.CoinName = dicts.DKey; } } res.Models = GetApplyAmounts; res.Total = num; return(res); }
public PageModel <MargainBill> GetBargain <Tout>(BargainQuery bargainQuery) { IQueryable <MargainBill> platform = context.MargainBill.AsQueryable <MargainBill>(); if (bargainQuery.StartDate.HasValue) { DateTime value = bargainQuery.StartDate.Value; platform = from d in platform where d.CreateDate >= value select d; } if (bargainQuery.EndDate.HasValue) { DateTime dateTime = bargainQuery.EndDate.Value; DateTime dateTime1 = dateTime.AddDays(1).AddSeconds(-1); platform = from d in platform where d.CreateDate <= dateTime1 select d; } if (bargainQuery.ShopId.HasValue) { platform = from item in platform where item.ShopId == bargainQuery.ShopId select item; } if (!string.IsNullOrWhiteSpace(bargainQuery.BillNo)) { platform = from item in platform where item.BillNo == bargainQuery.BillNo select item; } if (bargainQuery.BillStatus.HasValue) { platform = from item in platform where item.BillStatus == bargainQuery.BillStatus select item; } //筛选掉已删除的询盘 platform = from item in platform where item.BillStatus != EnumBillStatus.BargainDelete select item; int num = platform.Count(); platform = platform.GetPage(out num, bargainQuery.PageNo, bargainQuery.PageSize); foreach (MargainBill list in platform.ToList()) { UserMemberInfo memberInfo = context.UserMemberInfo.FirstOrDefault((UserMemberInfo m) => m.Id.Equals(list.MemberId)); list.MemberName = memberInfo.UserName; ChemCloud_Dictionaries dictionaryInfo = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 1 && m.DValue == list.CoinType.ToString()); list.CoinTypeName = (dictionaryInfo == null ? "" : dictionaryInfo.DKey); } return(new PageModel <MargainBill>() { Models = platform, Total = num }); }
public PageModel <MessageSetting> GetSettings(MessageSettingQuery messageSettingQueryModel) { IQueryable <MessageSetting> MessageSettings = context.MessageSetting.AsQueryable <MessageSetting>(); MessageSettings = from item in MessageSettings select item; if (messageSettingQueryModel.Id > 0) { MessageSettings = from item in MessageSettings where item.Id == messageSettingQueryModel.Id select item; } if (messageSettingQueryModel.MessageNameId.HasValue && messageSettingQueryModel.MessageNameId.Value != 0) { MessageSetting.MessageModuleStatus value = messageSettingQueryModel.MessageNameId.Value; DateTime dateTime = DateTime.Now.Date.AddSeconds(-1); MessageSetting.MessageModuleStatus ActiveStatu = value; if (ActiveStatu == MessageSetting.MessageModuleStatus.OrderCreated) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 1 select d; } else { if (ActiveStatu == MessageSetting.MessageModuleStatus.OrderPay) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 2 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.OrderShipping) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 3 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.OrderRefund) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 4 select d; } //if (ActiveStatu == MessageSetting.MessageModuleStatus.FindPassWord) //{ // MessageSettings = // from d in MessageSettings // where (int)d.MessageNameId == 5 // select d; //} if (ActiveStatu == MessageSetting.MessageModuleStatus.ShopAudited) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 6 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.ShopResult) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 7 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.CertificationApply) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 8 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.ConfirmPay) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 9 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.CertificationResult) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 10 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.LogisticsRece) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 11 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.LogisticsClearance) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 12 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.LogisticsSignIn) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 13 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.MemberRegister) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 14 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.SupplierRegister) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 15 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.GoodsPayment) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 16 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.RegisterMailContent) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 17 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.RegisterMailContent_GYS) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 18 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.XunPan) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 19 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.CustomMessage) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 20 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.LimitedAount) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 21 select d; } if (ActiveStatu == MessageSetting.MessageModuleStatus.ApplyPass) { MessageSettings = from d in MessageSettings where (int)d.MessageNameId == 22 select d; } } } if (messageSettingQueryModel.Status.HasValue && messageSettingQueryModel.Status.Value != 0) { MessageSettings = from d in MessageSettings where (int)d.ActiveStatus == messageSettingQueryModel.Status select d; } int num = MessageSettings.Count(); foreach (MessageSetting ms in MessageSettings.ToList()) { ChemCloud_Dictionaries dicts = context.ChemCloud_Dictionaries.FirstOrDefault((ChemCloud_Dictionaries m) => m.DictionaryTypeId == 10 && m.DValue == ms.Languagetype.ToString()); ms.LanguageName = dicts.DKey; } MessageSettings = MessageSettings.GetPage(out num, messageSettingQueryModel.PageNo, messageSettingQueryModel.PageSize); return(new PageModel <MessageSetting>() { Models = MessageSettings, Total = num }); }