bool ISync.Download(string machineID) { try { ShowMessage("同步就餐計劃主檔..."); List<DinnerScheduleMaster_dsm_Info> sourceList; DinnerBL dinnerBL = new DinnerBL(); DinnerScheduleMaster_dsm_Info cond = new DinnerScheduleMaster_dsm_Info(); cond.dsm_lIsAtive = true; sourceList = dinnerBL.SearchRecords(cond); using (DBContext uow = DBContext.Begin(NHConfigFactory.DBConfig.PPC)) { uow.CurrentSession.CreateQuery("delete from DinnerScheduleMaster_dsm_Info").ExecuteUpdate(); foreach (var item in sourceList) { uow.CurrentSession.Save(item); } } return true; } catch (Exception ex) { Common.General.BLLoger.Error(ex); return false; //throw ex; } }
public DinnerSchedule() { InitializeComponent(); mLog = Common.General.PPCLogger; this.lvInfo.Font = ControlSetting.ListFont; mDinnerScheduleMasterBL = new DinnerBL(); mShiftTypeMasterBL = MasterBLLFactory.GetBLL<IShiftTypeMasterBL>(MasterBLLFactory.ShiftTypeMaster_stm); mAreaMasterBL = new AreaMasterBL(); }
public DinnerScheduleAppSetting() { InitializeComponent(); _DinnerScheduleMasterBL = new DinnerBL(); _CurrentAfwInfo = null; _isChanged = false; //todo: 需初始化用戶信息 if (base.UserInformation == null) { base.UserInformation = new Model.SysMaster.Sys_UserMaster_usm_Info(); base.UserInformation.usm_cUserLoginID = "sys"; } }