private void InitData() { try { string message; SupplyUnits = PharmacyDatabaseService.AllSupplyUnits(out message) .ToList(); SupplyUnits.Insert(0, new SupplyUnit { Id = Guid.Empty, Name = "请您选择..." }); queryModel = new QuerySupplyUnitSalesmanModel(); queryModel.OutDateFrom = TypesDefaultValues.MaxDateTime; queryModel.OutDateTo = TypesDefaultValues.MinDateTime; queryModel.BirthdayFrom = TypesDefaultValues.MaxDateTime; queryModel.BirthdayTo = TypesDefaultValues.MinDateTime; queryModel.CreateTimeFrom = TypesDefaultValues.MaxDateTime; queryModel.CreateTimeTo = TypesDefaultValues.MinDateTime; queryModel.UpdateTimeFrom = TypesDefaultValues.MaxDateTime; queryModel.UpdateTimeTo = TypesDefaultValues.MinDateTime; } catch (Exception ex) { ex = new Exception("初始化数据失败", ex); Log.Error(ex); MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void InitData() { try { string message; SupplyUnits = PharmacyDatabaseService.AllSupplyUnits(out message) .ToList(); switch (RunMode) { case FormRunMode.Add: Entity = new SupplyUnitSalesman(); Entity.Birthday = TypesDefaultValues.MinDateTime; Entity.BusinessScopes = string.Empty; Entity.CreateTime = DateTime.Now; Entity.CreateUserId = AppClientContext.CurrentUser.Id; Entity.Deleted = false; Entity.Enabled = true; Entity.Gender = "男"; Entity.IsOutDate = false; Entity.OutDate = TypesDefaultValues.MaxDateTime; Entity.UpdateTime = DateTime.Now; Entity.UpdateUserId = AppClientContext.CurrentUser.Id; //string message; //GSPLicense = PharmacyDatabaseService.GetGSPLicense(out message, gMSPLicenseId); //if (GMSPLicenseBusinessScopes == null) //{ // GMSPLicenseBusinessScopes = thisAllBusinessScopes(out message); //} break; case FormRunMode.Edit: break; case FormRunMode.Browse: break; case FormRunMode.Search: break; case FormRunMode.Delete: break; default: break; } //初始化字典数据 SupplyUnits.Insert(0, new SupplyUnit { Id = Guid.Empty, Name = "请您选择..." }); Districts = PharmacyDatabaseService.AllDistricts(out message).ToList(); Districts.Insert(0, new District { Id = Guid.Empty, Name = "请您选择..." }); Genders = new List <ListItem>(); Genders.Add(new ListItem { ID = "-1", Name = "未知" }); Genders.Add(new ListItem { ID = "1", Name = "男" }); Genders.Add(new ListItem { ID = "0", Name = "女" }); } catch (Exception ex) { ex = new Exception("初始化数据失败", ex); Log.Error(ex); MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }