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 FormPurchaseOrderList_Load(object sender, EventArgs e) { BindComboBoxStatus(); BindComboBoxSupply(); btnSearch_Click(this, null); var all = PharmacyDatabaseService.AllSupplyUnits(out msg); listSupplyer = all.Where(r => r.Valid).ToList(); }
private void BindComboBoxSupply() { string msg = string.Empty; SupplyUnit[] listSupply = PharmacyDatabaseService.AllSupplyUnits(out msg); this.cmbSupply.DataSource = listSupply; this.cmbSupply.DisplayMember = "Name"; this.cmbSupply.ValueMember = "Id"; this.cmbSupply.SelectedIndex = -1; }
public ucPurchaseRecord() { InitializeComponent(); dtpFrom.Value = DateTime.Now.AddDays(-3); dtpTo.Value = DateTime.Now; BindComboBoxSupply(); var all = PharmacyDatabaseService.AllSupplyUnits(out msg); listSupplyer = all.Where(r => r.Valid).ToList(); this.dataGridView1.RowPostPaint += delegate(object o, DataGridViewRowPostPaintEventArgs ex) { DataGridViewOperator.SetRowNumber((DataGridView)o, ex); }; this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; }
private void FormPurchaseOrderCreateBySupplyer_Load(object sender, EventArgs e) { var all = PharmacyDatabaseService.AllSupplyUnits(out msg); listSupplyer = all.Where(r => r.Valid).ToList(); }
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); } }