//public IQueryable<Sys_AllSetting> GetAll() //{ // IQueryable<Sys_AllSetting> result = this.DbSet.ToList().AsQueryable(); // return result; //} /// <summary> /// Lấy đối tượng overtime bởi store hrm_att_sp_get_OvertimeByProfileId [Tam.Le - 2014/05/19] /// </summary> /// <returns></returns> public string GetSubMenu(Sys_AllSettingEntity model) { var result = this.UnitOfWork.Context.Database.SqlQuery <Sys_AllSettingEntity>(ConstantSql.hrm_sys_sp_get_UserSetting_Submenu, new SqlParameter { ParameterName = "Name", Value = model.Name }, new SqlParameter { ParameterName = "Keyword", Value = model.Value1 }, new SqlParameter { ParameterName = "UserID", Value = model.UserID }).FirstOrDefault(); if (result == null) { return(""); } else { return(result.Value2); } }
public Sys_AllSettingModel Put(Sys_AllSettingModel model) { var sysAllSetting = new Sys_AllSettingEntity { ID = model.ID, Name = model.Name, Value1 = model.Value1, Value2 = model.Value2, ModuleName = model.ModuleName, UserID = model.UserID }; var service = new Sys_AllSettingServices(); if (model.ID != Guid.Empty) { sysAllSetting.ID = model.ID; service.Edit <Sys_AllSettingEntity>(sysAllSetting); } else { service.Add <Sys_AllSettingEntity>(sysAllSetting); } return(model); }
public Sys_AllSettingModel Put(Sys_AllSettingModel model) { var sysAllSetting = new Sys_AllSettingEntity { ID = model.ID, Name = model.Name + "_" + model.UserID.ToString(), Value1 = model.Value1, Value2 = model.Value2, ModuleName = model.ModuleName, UserID = model.UserID }; //var service = new Sys_AllSettingServices(); //if (model.ID != Guid.Empty) //{ // sysAllSetting.ID = model.ID; // service.Edit<Sys_AllSettingEntity>(sysAllSetting); //} //else //{ // service.Add<Sys_AllSettingEntity>(sysAllSetting); //} var sysAllSettingServices = new Sys_AttOvertimePermitConfigServices(); sysAllSettingServices.CreateOrUpdateSysAllSetting(sysAllSetting.Name, model.Value1); return model; }
/// <summary> /// [Tam.Le 8.1.2014 Modify] /// </summary> /// <param name="request"></param> /// <param name="model"></param> /// <returns></returns> public string CheckConnectTAM() { var service = new Lau_TamServices(); string message = ""; bool status = false; bool isconnect = service.IsConnected(AppConfig.HRM_SYS_LAU_TAMSCANLOG_1_, ref message); if (isconnect == true) { status = true; } else { status = false; } var sys_AllSetting = new Sys_AllSettingEntity(); sys_AllSetting = LibraryService.GetSys_AllSettingByKey(Constant.HRM_SYS_COMPUTE_TAMLOG_LAU); string result = string.Empty; string DateFrom = string.Empty; string DateTo = string.Empty; if (sys_AllSetting != null) { DateFrom = sys_AllSetting.Value2 != null?sys_AllSetting.Value2.ToString() : string.Empty; DateTo = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToString().Split(' ')[1] + " " + DateTime.Now.ToString().Split(' ')[2]; } result = status.ToString() + "|" + DateFrom + "|" + DateTo; return(result); }
public static Sys_AllSettingEntity GetSys_AllSettingByKey(string key) { var service = new BaseService(); var sys_AllSetting = new Sys_AllSettingEntity(); string status = string.Empty; var lstEntity = service.GetData <Sys_AllSettingEntity>(key, ConstantSql.hrm_sys_sp_get_AllSettingByKey, string.Empty, ref status); if (lstEntity != null) { sys_AllSetting = lstEntity.FirstOrDefault(); } return(sys_AllSetting); }
/// <summary> /// Lấy toàn bộ data theo store /// </summary> /// <returns></returns> public string GetSubmenu(string name, string key, Guid user) { using (var context = new VnrHrmDataContext()) { var unitOfWork = (IUnitOfWork)(new UnitOfWork(context)); var repo = new Sys_AllSettingRepository(unitOfWork); Sys_AllSettingEntity entity = new Sys_AllSettingEntity(); entity.Name = name; entity.Value1 = key; entity.UserID = user; var result = string.Empty;// repo.GetSubMenu(entity); return(result); } }