/// <summary> /// /// </summary> /// <param name="appSettings"></param> public LoginController(IOptions <AppAuthenticationSettings> appSettings, haikanHeQiaoContext dbContext, IOptions <MdDesEncrypt> mdDesEncrypt, ILogger <TestController> logger) { _appSettings = appSettings.Value; _dbContext = dbContext; MdDesEncrypt = mdDesEncrypt.Value; _logger = logger; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public UserController(haikanHeQiaoContext dbContext, IMapper mapper, IOptions <MdDesEncrypt> mdDesEncrypt, IOptions <AppAuthenticationSettings> appSettings) { _appSettings = appSettings.Value; _dbContext = dbContext; _mapper = mapper; MdDesEncrypt = mdDesEncrypt.Value; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public GereninfoController(haikanHeQiaoContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment, ILogger <GereninfoController> logger) { _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; _logger = logger; }
/// <summary> /// 获取村庄名或科室名 /// </summary> /// <param name="uuid">村庄或科室uuid</param> public static string getdept(string uuid) { using (haikanHeQiaoContext haikan = new haikanHeQiaoContext()) { var deptname = ""; if (uuid != null && uuid != "") { string[] deName = uuid.Split(","); foreach (var item in deName) { if (item != "") { var keshidata = haikan.Department.FirstOrDefault(x => x.DepartmentUuid == Guid.Parse(item)); var czdata = haikan.Town.FirstOrDefault(x => x.TownUuid == Guid.Parse(item)); if (keshidata != null) { deptname += keshidata.Name + ","; } if (czdata != null) { deptname += czdata.TownName + ","; } } } } return(deptname); } }
/// <summary> /// 获取负责人 /// </summary> /// <returns></returns> public static string getfuzeren(string uuids) { string name = ""; using (haikanHeQiaoContext hc = new haikanHeQiaoContext()) { var data = uuids.Split(','); if (data.Length - 1 > 3)//人数超过3人 { for (int i = 0; i < 3; i++) { if (data[i] != "" && data[i] != null) { name += hc.SystemUser.First(x => x.SystemUserUuid == Guid.Parse(data[i])).RealName + ","; } } name = name.Trim(',') + "..."; } else { for (int i = 0; i < data.Length; i++) { if (data[i] != "" && data[i] != null) { name += hc.SystemUser.First(x => x.SystemUserUuid == Guid.Parse(data[i])).RealName + ","; } } name = name.Trim(','); } } return(name); }
public static string GetUserName(Guid?UserUuid, haikanHeQiaoContext _dbContext) { string stau = ""; var querys = _dbContext.SystemUser.FirstOrDefault(x => x.SystemUserUuid == UserUuid); stau = querys.LoginName; return(stau); }
/// <summary> /// 获取酒店当日订单总数 /// </summary> /// <param name="guid"></param> /// <returns></returns> public static int GetRdingdan(string HotelName) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { var d5 = DateTime.Now.ToString("yyyy-MM-dd"); int num = cc.RuzhuInfo.Where(x => x.HotelName == HotelName && x.IsDeleted != 1 && x.RuzhuTime.Substring(0, 10) == d5).Count(); return(num); } }
/// <summary> /// 获取酒店当月入住总人数 /// </summary> /// <param name="guid"></param> /// <returns></returns> public static int GetYrenshu(string HotelName) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { var d5 = DateTime.Now.ToString("yyyy-MM"); int num = cc.RuzhuInfo.Where(x => x.HotelName == HotelName && x.IsDeleted != 1 && x.RuzhuTime.Substring(0, 7) == d5).Select(x => new { x.RuzhuPeople }).Sum(x => Convert.ToInt32(x.RuzhuPeople)); return(num); } }
/// <summary> /// 获取当日游客量 /// </summary> /// <param name="guid"></param> /// <returns></returns> public static int GetRdingdan(string ScenicName) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { var d5 = DateTime.Now.ToString("yyyy-MM-dd"); int num = cc.Tourist.Where(x => x.ScenicName == ScenicName && x.IsDeleted != 1 && x.TouristTime.Substring(0, 10) == d5).Count(); return(num); } }
public static int organpeople(Guid guid) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { int num = cc.OrganPeoInfo.Where(x => x.OrganizationUuid == guid && x.IsDeleted != 1).Count(); var query = cc.Organization.FirstOrDefault(x => x.OrganizationUuid == guid); query.OrganizationPeople = num.ToString(); cc.SaveChanges(); return(num); } }
/// <summary> /// 获取村镇人口 /// </summary> /// <param name="guid"></param> /// <returns></returns> public static int GetTownPeople(string TownName) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { int num = cc.Userinfoty.Where(x => x.Residence.Contains(TownName) && x.IsDeleted != 1).Count(); var query = cc.Town.FirstOrDefault(x => x.TownName == TownName); query.TownPeople = num.ToString(); cc.SaveChanges(); return(num); } }
public static int organpeople(string DangOrganizationName) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { int num = cc.CpcmanInfo.Where(x => x.DangOrganizationName == DangOrganizationName && x.IsDeleted != 1).Count(); var query = cc.DangOrganization.FirstOrDefault(x => x.DangOrganizationName == DangOrganizationName); query.DangOrganizationPeople = num.ToString(); cc.SaveChanges(); return(num); } }
public static string GetDistance(Guid ScenicSpotUuid, haikanHeQiaoContext _dbContext, Guid UserUuid) { string stau = "未打卡"; int querys = _dbContext.Attractions.Where(x => x.UserUuid == UserUuid && x.SceientUuid == ScenicSpotUuid).ToList().Count(); if (querys > 0) { stau = "已打卡"; } return(stau); }
/// <summary> /// 获取酒店当月入住总人数 /// </summary> /// <param name="guid"></param> /// <returns></returns> public static int Gettianshu(Guid RuzhuInfoUuid) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { var dd = cc.RuzhuInfo.FirstOrDefault(x => x.RuzhuInfoUuid == RuzhuInfoUuid); DateTime d1 = Convert.ToDateTime(dd.RuzhuTime); DateTime d2 = Convert.ToDateTime(dd.LikaiTime); DateTime d3 = Convert.ToDateTime(string.Format("{0}-{1}-{2}", d1.Year, d1.Month, d1.Day)); DateTime d4 = Convert.ToDateTime(string.Format("{0}-{1}-{2}", d2.Year, d2.Month, d2.Day)); int num = (d4 - d3).Days; return(num); } }
public static string AddLog(string Typem, string Content, haikanHeQiaoContext _dbContext) { string messange = ""; var entity = new HaiKanTravelManagementSystem.Api.Entities.SystemLog(); entity.SystemLogUuid = Guid.NewGuid(); entity.UserId = AuthContextService.CurrentUser.Guid.ToString(); entity.UserName = AuthContextService.CurrentUser.LoginName; entity.Type = Typem; entity.OperationContent = Content; entity.OperationTime = DateTime.Now; entity.AddTime = DateTime.Now; entity.AddPeople = "系统日志"; entity.IsDelete = 0; _dbContext.SystemLog.Add(entity); _dbContext.SaveChanges(); return(messange); }
/// <summary> /// 判断任务是否逾期 /// </summary> /// <returns></returns> public static string panduanyuqi(string time, Guid uuid) { string yuqi = "否"; if (Convert.ToDateTime(time) < DateTime.Now)//已经逾期 { using (haikanHeQiaoContext hk = new haikanHeQiaoContext()) { var entity = hk.Mission.FirstOrDefault(x => x.MissionUuid == uuid); if (entity.Isouttime != "1") { entity.Isouttime = "1";//变为逾期 hk.SaveChanges(); } } yuqi = "是"; } return(yuqi); }
private string GetroleName(string ids) { string s = ""; string[] temp = ids.TrimEnd(',').Split(','); using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { 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(',')); } }
/// <summary> /// 获取村庄名或科室名 /// </summary> /// <param name="uuid">村庄或科室uuid</param> public static string getdept(string uuid) { using (haikanHeQiaoContext haikan = new haikanHeQiaoContext()) { var deptname = ""; if (uuid != null && uuid != "") { var keshidata = haikan.Department.FirstOrDefault(x => x.DepartmentUuid == Guid.Parse(uuid)); var czdata = haikan.Town.FirstOrDefault(x => x.TownUuid == Guid.Parse(uuid)); if (keshidata != null) { deptname = keshidata.Name; } if (czdata != null) { deptname = czdata.TownName; } } return(deptname); } }
public static float one(string db, string jb) { using (haikanHeQiaoContext cc = new haikanHeQiaoContext()) { //var num = cc.Tongji.FirstOrDefault(x => x.TjYear == db && x.TjJidu == jb); //double dd = 0; //if (num != null) //{ // dd = Math.Round((double)num.Num * 0.0001,5); //} //return dd; var num = cc.Tongji.FirstOrDefault(x => x.TjYear == db && x.TjJidu == jb); float dd = 0; if (num != null) { int i = (int)(num.Num * 100); dd = (float)(i * 1.0) / 1000000; } return(dd); } }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public PromoInfoController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public SceneController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public wocanyutaskController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
/// <summary> /// /// </summary> /// <param name = "dbContext" ></ param > /// < param name="mapper"></param> public OrganInfoController(haikanHeQiaoContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment) { _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public PermissionController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public expiringSoontaskController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
//private IWebHostEnvironment _hostingEnvironment; /// <summary> /// /// </summary> /// <param name = "dbContext" ></ param > /// < param name="mapper"></param> public RescueTeamController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; //_hostingEnvironment = hostingEnvironment; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> public AccountController(haikanHeQiaoContext dbContext) { _dbContext = dbContext; }
/// <summary> /// /// </summary> /// <param name = "dbContext" ></ param > /// < param name="mapper"></param> public SecurityPersonController(haikanHeQiaoContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment) { _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public smokeInductionController(haikanHeQiaoContext dbContext, IMapper mapper, IWebHostEnvironment hostingEnvironment) { _dbContext = dbContext; _mapper = mapper; _hostingEnvironment = hostingEnvironment; }
/// <summary> /// /// </summary> /// <param name="dbContext"></param> /// <param name="mapper"></param> public TourismiffoController(haikanHeQiaoContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }