예제 #1
0
        public List <ScaleSettings> GetAllSettingsByStore()
        {
            var store = Sys.SysCommonRules.CurrentStore;
            var datas = ScaleSettingsService.FindList((o) => o.CompanyId == Sys.SysCommonRules.CompanyId && o.Store == store);

            return(datas);
        }
예제 #2
0
        public OpResult RemoveSetting(int id)
        {
            var data = ScaleSettingsService.FindById(id);

            if (data == null)
            {
                return(OpResult.Fail("未找到对应数据!"));
            }
            else
            {
                return(ScaleSettingsService.Delete(data));
            }
        }
예제 #3
0
        public OpResult CreateSetting(ScaleSettings setting)
        {
            if (string.IsNullOrEmpty(setting.IpAddress))
            {
                return(OpResult.Fail("IP地址数据异常!"));
            }
            var r = ScaleSettingsService.IsExist(p => p.IpAddress == setting.IpAddress && p.CompanyId == Sys.SysCommonRules.CompanyId && p.Store == Sys.SysCommonRules.CurrentStore);

            if (r)
            {
                return(OpResult.Fail("IP地址重复!"));
            }
            setting.CreateDt  = DateTime.Now;
            setting.CreateUID = Sys.CurrentUser.UID;
            setting.CompanyId = Sys.SysCommonRules.CompanyId;
            setting.Store     = Sys.SysCommonRules.CurrentStore;
            return(ScaleSettingsService.Add(setting));
        }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ip"></param>
 /// <returns></returns>
 public ScaleSettings GetSettingByIp(string ip)
 {
     return(ScaleSettingsService.Find(o => o.IpAddress == ip));
 }