/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public UserController(haikanSDMSContext dbContext, IMapper mapper, IOptions <MdDesEncrypt> mdDesEncrypt, IOptions <AppAuthenticationSettings> appSettings) { _appSettings = appSettings.Value; _dbContext = dbContext; _mapper = mapper; MdDesEncrypt = mdDesEncrypt.Value; }
public FlowController(haikanSDMSContext dbContext, IMapper mapper, IWebHostEnvironment env, haikanITMContext dbITMContext) { _dbContext = dbContext; _dbITMContext = dbITMContext; _mapper = mapper; _hostEnv = env; }
private static string GetIngredient(string Ingredient, haikanSDMSContext _dbContext) { using (haikanSDMSContext cc = new haikanSDMSContext()) { bool isChinese = false; if (string.IsNullOrEmpty(Ingredient)) { return(""); } foreach (char ch in Ingredient) { //判断字符ch是否为汉字字符 if (ch >= 0x4e00 && ch <= 0x9fbb) { isChinese = true; break; } } if (isChinese) { return(Ingredient); } else { var uuids = Ingredient.ToUpper().Split(',').ToList(); var list = cc.Ingredient.Where(x => uuids.Contains(x.IngredientUuid.ToString())).Select(x => x.FoodName).ToList(); var names = string.Join(',', list); return(names); } } }
//private static string Mch_id = ""; public StudentBillController(haikanSDMSContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment, ILogger <StudentBillController> logger) { _dbContext = dbContext; _mapper = mapper; _logger = logger; //_hostingEnvironment = hostingEnvironment; }
/// <summary> /// 获取食材名称 /// </summary> /// <returns></returns> private static string FoodName(string uuids, haikanSDMSContext dbContext) { if (string.IsNullOrEmpty(uuids)) { return(""); } var idls = uuids.ToUpper().Split(',').ToList(); var list = dbContext.Ingredient.Where(x => idls.Contains(x.IngredientUuid.ToString())).Select(x => x.FoodName).ToList(); var names = string.Join(',', list); return(names); }
private static string GetIngredient(string Ingredient, haikanSDMSContext _dbContext) { if (string.IsNullOrEmpty(Ingredient)) { return(""); } var uuids = Ingredient.ToUpper().Split(',').ToList(); var list = _dbContext.Ingredient.Where(x => uuids.Contains(x.IngredientUuid.ToString())).Select(x => x.FoodName).ToList(); var names = string.Join(',', list); return(names); }
private static string GetPeople(string systemUserUuid, haikanSDMSContext _dbContext) { if (string.IsNullOrEmpty(systemUserUuid)) { return(""); } var uuids = systemUserUuid.ToUpper().Split(',').ToList(); var list = _dbContext.SystemUser.Where(x => uuids.Contains(x.SystemUserUuid.ToString())).Select(x => x.RealName).ToList(); var names = string.Join(',', list); return(names); }
/// <summary> /// 上周价格 /// </summary> /// <param name="guid"></param> /// <returns></returns> public static double OldPurchase(Guid guid) { using (haikanSDMSContext cc = new haikanSDMSContext()) { double num = 0; var olddate = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"); var query = cc.PurchaseRecord.Where(x => x.PurchaseDate.Substring(0, 10) == olddate && x.IsDelete == 0 && x.IngredientUuid == guid); if (query.Count() > 0) { var query1 = query.OrderByDescending(x => x.PurchaseDate).First(); num = query1.Price.Value; } return(num); } }
private static List <DateMenu> GetMenus(string date, string week) { using (haikanSDMSContext cc = new haikanSDMSContext()) { var query = cc.Cuisine.Where(x => date.Contains(x.CuisineUuid.ToString())).Select(x => new DateMenu { CuisineName = x.CuisineName, CuisineType = x.CuisineType, Abstract = x.Abstract, Ingredient = GetIngredient(x.Ingredient, cc), Burdening = GetIngredient(x.Burdening, cc), LikeNum = x.LikeNum, Price = x.Price, CuisineUuid = x.CuisineUuid, Accessory = x.Accessory, Date = week }).ToList(); return(query); } }
private string GetroleName(string ids) { string s = ""; string[] temp = ids.TrimEnd(',').Split(','); using (haikanSDMSContext cc = new haikanSDMSContext()) { for (int i = 0; i < temp.Length; i++) { if (!string.IsNullOrEmpty(temp[i])) { var qu = cc.SystemRole.Where(x => x.SystemRoleUuid == Guid.Parse(temp[i])).Select(x => new { x.RoleName }).ToList(); if (!string.IsNullOrEmpty(qu[0].RoleName)) { s += qu[0].RoleName + ","; } } } return(s.TrimEnd(',')); } }
//private IWebHostEnvironment _hostingEnvironment; public ClassController(haikanSDMSContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment) { _dbContext = dbContext; _mapper = mapper; //_hostingEnvironment = hostingEnvironment; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public PictureController(haikanSDMSContext dbContext, IMapper mapper, IHostingEnvironment env) { _dbContext = dbContext; _mapper = mapper; hostingEnv = env; }
public SchoolLifeController(haikanSDMSContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment) { _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public WxMessageBoardController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public AppMoneyController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public AppCuisineController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
private static string GetPurchase(string Ingredient, string Burdening, int type, haikanSDMSContext _dbContext) { double heat = 0; double Protein = 0; double Fat = 0; double Saccharides = 0; double Va = 0; bool isChinese = false; var num = ""; if (string.IsNullOrEmpty(Ingredient) && string.IsNullOrEmpty(Burdening)) { return("0"); } else if (string.IsNullOrEmpty(Ingredient)) { foreach (char ch in Burdening) { //判断字符ch是否为汉字字符 if (ch >= 0x4e00 && ch <= 0x9fbb) { isChinese = true; break; } } if (!isChinese) { var uuids = Burdening.ToUpper().Split(',').ToList(); var lists = _dbContext.Ingredient.Where(x => uuids.Contains(x.IngredientUuid.ToString())).Select(x => new { x.HeatEnergy, x.Protein, x.Fat, x.Saccharides, x.Va }).ToList(); heat = lists.Sum(x => x.HeatEnergy.Value); Protein = lists.Sum(x => x.Protein.Value); Fat = lists.Sum(x => x.Fat.Value); Saccharides = lists.Sum(x => x.Saccharides.Value); Va = lists.Sum(x => x.Va.Value); } } else if (string.IsNullOrEmpty(Burdening)) { foreach (char ch in Ingredient) { //判断字符ch是否为汉字字符 if (ch >= 0x4e00 && ch <= 0x9fbb) { isChinese = true; break; } } if (!isChinese) { var uuid = Ingredient.ToUpper().Split(',').ToList(); var lists = _dbContext.Ingredient.Where(x => uuid.Contains(x.IngredientUuid.ToString())).Select(x => new { x.HeatEnergy, x.Protein, x.Fat, x.Saccharides, x.Va }).ToList(); heat = lists.Sum(x => x.HeatEnergy.Value); Protein = lists.Sum(x => x.Protein.Value); Fat = lists.Sum(x => x.Fat.Value); Saccharides = lists.Sum(x => x.Saccharides.Value); Va = lists.Sum(x => x.Va.Value); } } else { foreach (char ch in Ingredient + Burdening) { //判断字符ch是否为汉字字符 if (ch >= 0x4e00 && ch <= 0x9fbb) { isChinese = true; break; } } if (!isChinese) { var uuid = Ingredient.ToUpper().Split(',').ToList(); var uuids = Burdening.ToUpper().Split(',').ToList(); var list = _dbContext.Ingredient.Where(x => uuid.Contains(x.IngredientUuid.ToString())).Select(x => new { x.HeatEnergy, x.Protein, x.Fat, x.Saccharides, x.Va }).ToList(); var lists = _dbContext.Ingredient.Where(x => uuids.Contains(x.IngredientUuid.ToString())).Select(x => new { x.HeatEnergy, x.Protein, x.Fat, x.Saccharides, x.Va }).ToList(); double heats = list.Sum(x => x.HeatEnergy.Value); double Proteins = list.Sum(x => x.Protein.Value); double Fats = list.Sum(x => x.Fat.Value); double Saccharidess = list.Sum(x => x.Saccharides.Value); double Vas = list.Sum(x => x.Va.Value); heat = lists.Sum(x => x.HeatEnergy.Value) + heats; Protein = lists.Sum(x => x.Protein.Value) + Proteins; Fat = lists.Sum(x => x.Fat.Value) + Fats; Saccharides = lists.Sum(x => x.Saccharides.Value) + Saccharidess; Va = lists.Sum(x => x.Va.Value) + Vas; } } if (type == 1) { num = heat.ToString(); } if (type == 2) { num = Protein.ToString(); } if (type == 3) { num = Fat.ToString(); } if (type == 4) { num = Saccharides.ToString(); } if (type == 5) { num = Va.ToString(); } return(num); }
public moneyController(haikanSDMSContext dbContext, IMapper mapper, IHostingEnvironment hostingEnvironment) { _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; }
public PurchaseRecordController(haikanSDMSContext dbContext, IMapper mapper, IWebHostEnvironment env) { _dbContext = dbContext; _mapper = mapper; _hostEnv = env; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public WxSurveyController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public StudentController(haikanSDMSContext dbContext, IMapper mapper, IWebHostEnvironment env) { _dbContext = dbContext; _mapper = mapper; _hostEnv = env; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> public AccountController(IOptions <AppAuthenticationSettings> appSettings, haikanSDMSContext dbContext) { _dbContext = dbContext; _appSettings = appSettings.Value; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public AppWeekMenuController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public campusnewsController(haikanSDMSContext dbContext, IMapper mapper, haikanITMDContext DdbContext) { _dbContext = dbContext; _mapper = mapper; _DdbContext = DdbContext; }
public ActicleController(haikanSDMSContext dbContext, IMapper mapper, haikanITMContext dbITMContext) { _dbContext = dbContext; _dbITMContext = dbITMContext; _mapper = mapper; }
public managePlanController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
/// <summary> /// /// </summary> /// <param name="appSettings"></param> public OauthController(IOptions <AppAuthenticationSettings> appSettings, haikanSDMSContext dbContext, IOptions <MdDesEncrypt> mdDesEncrypt) { _appSettings = appSettings.Value; _dbContext = dbContext; MdDesEncrypt = mdDesEncrypt.Value; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public PostjobsAppealController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public RoleController(haikanSDMSContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public UserInfoController(haikanSDMSContext dbContext, IMapper mapper, haikanITMContext dbITMContext) { _dbContext = dbContext; _dbITMContext = dbITMContext; _mapper = mapper; }