private void cmbmonth_SelectedIndexChanged(object sender, System.EventArgs e) { if (this.rdo2.Checked == true) { this.statusBar1.Panels[2].Text = Yp.Seekkjqj(Convert.ToInt32(cmbyear.Text), Convert.ToInt32(cmbmonth.Text), InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase); } }
private void cmbyplx_SelectedIndexChanged(object sender, EventArgs e) { if (cmbyplx.SelectedValue == null) { return; } if (cmbjx.SelectedValue == null) { return; } if (cmbyplx.SelectedValue.ToString() == "System.Data.DataRowView") { return; } if (cmbjx.SelectedValue.ToString() == "System.Data.DataRowView") { return; } Control control = (Control)sender; if (control.Name == "cmbyjks") { Yp.AddCmbYplx(true, Convert.ToInt32(Convertor.IsNull(cmbyjks.SelectedValue, "0")), cmbyplx, InstanceForm.BDatabase); } this.AddData(Convert.ToInt32(Convertor.IsNull(cmbyplx.SelectedValue, "0")), Convert.ToInt32(Convertor.IsNull(cmbjx.SelectedValue, "0")), txtdm.Text.Trim(), checkBox1.Checked, checkBox2.Checked, txthw.Text.Trim()); }
public Frmhwsz(MenuTag menuTag, string chineseName, Form mdiParent) { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); _menuTag = menuTag; _chineseName = chineseName; _mdiParent = mdiParent; this.Text = _chineseName; this.Text = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]"; if (menuTag.Function_Name == "Fun_ts_yp_xtwh_kwsz") { Yp.AddcmbYjks(cmbyjks, DeptType.药库, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); } else { Yp.AddcmbYjks(cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); } if (InstanceForm.BCurrentUser.IsAdministrator == false) { cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId; cmbyjks.Enabled = false; } Yp.AddCmbYplx(true, Convert.ToInt32(Convertor.IsNull(cmbyjks.SelectedValue, "0")), cmbyplx, InstanceForm.BDatabase); Yp.AddcmbYpjx(true, Convert.ToInt32(Convertor.IsNull(cmbyplx.SelectedValue, "0")), cmbjx, InstanceForm.BDatabase); cmbyplx.Text = "全部"; cmbjx.Text = "全部"; // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // }
private void Frmkccx_Load(object sender, System.EventArgs e) { this.dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); this.dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); Yp.AddCmbYplx(true, InstanceForm.BCurrentDept.DeptId, this.cmbyplx, InstanceForm.BDatabase); }
private void Frmtitle_Load(object sender, System.EventArgs e) { this.dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); this.dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); Yp.AddcmbCk(true, InstanceForm.BCurrentDept.DeptId, cmbck, InstanceForm.BDatabase); FunctionControlEnable(_menuTag.Function_Name.Trim()); }
public void Filldj(int ghdw, int ywy, long id) { _id = id; string ssql = ""; lblghdw.Text = Yp.SeekGhdw(ghdw, InstanceForm.BDatabase); Yp.AddcmbYwy(ghdw, cmbywy, InstanceForm.BDatabase); //添加已付款的记录 ssql = "select '0' 序号,cast(1 as smallint) 选,dbo.fun_yp_ghdw(wldw) 供货单位,dbo.fun_yp_ywy(jsr) 业务员,djh 单据号,sdjh 单据号X,rq 日期,sumjhje 进货金额," + " shdh 送货单号,fph 发票号,fprq 发票日期,djrq 登记时间,dbo.fun_getempname(a.djy) 登记员,id from " + _Table + " a,YP_FKJL B where a.id=b.djid and b.bdelete=0 and jllx=1"; if (id != 0) { ssql = ssql + " and fid=" + id + ""; } else { ssql = ssql + " and a.wldw=" + ghdw + ""; if (ywy != 0) { ssql = ssql + " and jsr=" + ywy + " "; } } ssql = ssql + " order by a.id"; DataTable tb = InstanceForm.BDatabase.GetDataTable(ssql); FunBase.AddRowtNo(tb); tb.TableName = "Tb"; this.myDataGrid1.DataSource = tb; //初始化其它信息 if (id != 0) { ssql = "select * from yp_fkqcjc where id=" + id + ""; tb = InstanceForm.BDatabase.GetDataTable(ssql); lblghdw.Text = Yp.SeekGhdw(Convert.ToInt32(tb.Rows[0]["ghdw"]), InstanceForm.BDatabase); lblghdw.Tag = tb.Rows[0]["ghdw"].ToString(); cmbywy.SelectedValue = tb.Rows[0]["ywy"].ToString(); cmbywy.Enabled = false; checkBox1.Enabled = false; checkBox1.Checked = Convert.ToInt32(tb.Rows[0]["ywy"]) > 0?true:false; txtye.Text = tb.Rows[0]["qcye"].ToString(); lbldjsj.Text = tb.Rows[0]["djsj"].ToString(); lbldjy.Text = Yp.SeekEmpName(Convert.ToInt32(tb.Rows[0]["djy"]), InstanceForm.BDatabase); txtbz.Text = tb.Rows[0]["bz"].ToString(); } else { lblghdw.Text = Yp.SeekGhdw(ghdw, InstanceForm.BDatabase); lblghdw.Tag = ghdw.ToString(); txtye.Text = ""; lbldjsj.Text = ""; lbldjy.Text = ""; txtbz.Text = ""; } }
private void butadd_Click(object sender, System.EventArgs e) { try { if (Convert.ToInt32(Convertor.IsNull(lblypmc.Tag, "0")) == 0) { MessageBox.Show("没有选择药品"); return; } if (Convertor.IsNumeric(Convertor.IsNull(lblypmc.Tag, "0")) == false) { MessageBox.Show("基数请输入数字"); return; } DataTable tb = (DataTable)this.myDataGrid1.DataSource; DataRow row = tb.NewRow(); int _ggid = Convert.ToInt32(Convertor.IsNull(lblypmc.Tag, "0")); DataRow[] selectrow = tb.Select("ggid='" + _ggid.ToString() + "'"); if (selectrow.Length > 0) { MessageBox.Show("当前药品已在列表添加了"); return; } Ypgg ydgg = new Ypgg(_ggid, InstanceForm.BDatabase); row["序号"] = tb.Rows.Count + 1; row["品名"] = ydgg.YPPM; row["商品名"] = ydgg.YPSPM; row["规格"] = ydgg.YPGG; //row["零售价"]=ydcj.LSJ; row["基数"] = Convertor.IsNull(txtjs.Text, "0"); row["单位"] = Yp.SeekYpdw(ydgg.YPDW, InstanceForm.BDatabase); //row["货号"]=ydcj.SHH; row["ggid"] = ydgg.GGID; row["启用日期"] = this.dtpqyrq.Value.ToShortDateString(); tb.Rows.Add(row); lblypmc.Text = ""; lblypmc.Tag = "0"; lblgg.Text = ""; //lblcj.Text=""; lbldw.Text = ""; //lbllsj.Text=""; //lblhh.Text=""; txtypdm.Text = ""; txtjs.Text = ""; txtypdm.Focus(); } catch (System.Exception err) { MessageBox.Show(err.Message); } }
private void cmbyplx_SelectedIndexChanged(object sender, System.EventArgs e) { if (this.cmbyplx.SelectedValue.GetType().ToString() != "System.Int32") { return; } int yplx = Convert.ToInt32(this.cmbyplx.SelectedValue); Yp.AddCmbYpzlx(Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")), yplx, this.cmbypzlx, InstanceForm.BDatabase); Yp.AddcmbYpjx(yplx, this.cmbypjx, InstanceForm.BDatabase); }
public static void UpdateKcxq(int cjid, string ypxq, string ypph, long deptid, RelationalDatabase _DataBase) { string table_kcph = Yp.Seek_kcph_table(deptid, _DataBase); string ssql = "update " + table_kcph + " set ypxq='" + ypxq + "' where cjid=" + cjid + " and deptid=" + deptid + " and ypph='" + ypph + "'"; int nrow = _DataBase.DoCommand(ssql); if (nrow != 1) { throw new System.Exception("错误,数据影响了多行或零行,请和管理员联系"); } }
private void cmbyear_SelectedIndexChanged(object sender, System.EventArgs e) { if (Convert.ToInt32(cmbck.SelectedValue) > 0) { Yp.AddcmbMonth(Convert.ToInt32(cmbck.SelectedValue), Convert.ToInt32(this.cmbyear.Text), cmbyear, cmbmonth, InstanceForm.BDatabase); } else { Yp.AddcmbMonth(Convert.ToInt32(cmbyjks.SelectedValue), Convert.ToInt32(this.cmbyear.Text), cmbyear, cmbmonth, InstanceForm.BDatabase); } }
private void Frmkccx_Load(object sender, System.EventArgs e) { this.dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); this.dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); this.rdo1.Checked = true; Yp.AddCmbYjks(true, InstanceForm.BCurrentDept.DeptId, cmbyjks, InstanceForm.BDatabase); Yp.AddcmbYear(Convert.ToInt32(cmbyjks.SelectedValue), cmbyear, InstanceForm.BDatabase); }
//输入框控制事件 private void TextKeyUp(object sender, KeyEventArgs e) //KeyEventArgs { int nkey = Convert.ToInt32(e.KeyCode); Control control = (Control)sender; if (control.Text.Trim() == "") { control.Text = ""; control.Tag = "0"; } if ((nkey >= 65 && nkey <= 90) || (nkey >= 48 && nkey <= 57) || (nkey >= 96 && nkey <= 105) || nkey == 8 || nkey == 32 || nkey == 46 || (nkey == 13 && (Convert.ToString(control.Tag) == "0" || Convert.ToString(control.Tag) == ""))) { } else { return; } try { Point point = new Point(this.Location.X + control.Location.X, this.Location.Y + control.Location.Y + control.Height * 3); switch (control.TabIndex) { case 0: if (control.Text.Trim() == "") { return; } if (_menuTag.Function_Name.Trim() == "Fun_ts_yf_ypptrk_qtrk") { Yp.frmShowCard(sender, ShowCardType.供货单位, 0, point, InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase); if (Convertor.IsNull(control.Tag, "0") != "0") { this.SelectNextControl((Control)sender, true, false, true, true); } } else { Yp.frmShowCard_funName(sender, ShowCardType.单据往来科室, _menuTag.Function_Name, point, InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase); if (Convertor.IsNull(control.Tag, "0") != "0") { this.SelectNextControl((Control)sender, true, false, true, true); } } break; } } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
private void Frmkccx_Load(object sender, System.EventArgs e) { FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); Yp.AddcmbYjks(cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); if (YpConfig.kslx(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) != DeptType.未知) { cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId; cmbyjks.Enabled = false; } txtxm.Enabled = true; }
public bool bpcgl;//是否进行批次管理 private void cmbyjks_SelectedIndexChanged(object sender, EventArgs e) { int deptid = Convert.ToInt32(Convertor.IsNull(cmbyjks.SelectedValue, "0")); bpcgl = Yp.BPcgl(deptid, InstanceForm.BDatabase); if (bpcgl) { //checkBox2.Visible = false; //checkBox2.Checked = true; //checkBox2.Text = "显示零售金额"; checkBox2.Checked = true; } }
private void FrmOptionData_Load(object sender, System.EventArgs e) { Yp.AddCmbYplx(false, Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")), this.cmbyplx, InstanceForm.BDatabase); cmbpxfs.SelectedIndex = 0; chkpxfs.Checked = true; string ssql = string.Format(" select name 统领分类, 0 选择,code from yp_tlfl "); DataTable tb = InstanceForm.BDatabase.GetDataTable(ssql); dataGridView1.DataSource = tb; }
private void myDataGrid1_CurrentCellChanged(object sender, System.EventArgs e) { try { int nrow = this.myDataGrid1.CurrentCell.RowNumber; int ncol = this.myDataGrid1.CurrentCell.ColumnNumber; string columnName = this.myDataGrid1.TableStyles[0].GridColumnStyles[ncol].HeaderText.Trim(); this.cmbyplx.Visible = false; this.cmbjxdl.Visible = false; if (columnName.Trim() == "统领分类") { DataTable tb = (DataTable)this.myDataGrid1.DataSource; if (nrow > tb.Rows.Count - 1) { return; } this.cmbyplx.Visible = true; this.cmbyplx.Left = this.myDataGrid1.GetCellBounds(nrow, ncol).Left + this.myDataGrid1.Left; this.cmbyplx.Top = this.myDataGrid1.GetCellBounds(nrow, ncol).Top + this.myDataGrid1.Top; this.cmbyplx.Width = this.myDataGrid1.GetCellBounds(nrow, ncol).Width; string tlfl = Convertor.IsNull(tb.Rows[nrow]["tlfl"], "0"); cmbyplx.Text = Yp.SeekTlfl(tlfl, InstanceForm.BDatabase); cmbyplx.Focus(); return; } if (columnName.Trim() == "剂型大类") { DataTable tb = (DataTable)this.myDataGrid1.DataSource; if (nrow > tb.Rows.Count - 1) { return; } this.cmbjxdl.Visible = true; this.cmbjxdl.Left = this.myDataGrid1.GetCellBounds(nrow, ncol).Left + this.myDataGrid1.Left; this.cmbjxdl.Top = this.myDataGrid1.GetCellBounds(nrow, ncol).Top + this.myDataGrid1.Top; this.cmbjxdl.Width = this.myDataGrid1.GetCellBounds(nrow, ncol).Width; string jxdl = Convertor.IsNull(tb.Rows[nrow]["jxdl"], "0"); cmbjxdl.Text = Convertor.IsNull(InstanceForm.BDatabase.GetDataResult("select jxmc from YP_YPJXDL where jxbm='" + jxdl + "'"), ""); cmbjxdl.Focus(); return; } } catch (System.Exception err) { MessageBox.Show(err.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void cmbmonth_SelectedIndexChanged(object sender, System.EventArgs e) { int nyear = Convert.ToInt32(Convertor.IsNull(cmbyear.Text, "0")); int nmonth = Convert.ToInt32(Convertor.IsNull(cmbmonth.Text, "0")); if (Convert.ToInt32(cmbck.SelectedValue) > 0) { this.statusBarPanel3.Text = Yp.Seekkjqj(nyear, nmonth, Convert.ToInt32(cmbck.SelectedValue), InstanceForm.BDatabase); } else { this.statusBarPanel3.Text = Yp.Seekkjqj(nyear, nmonth, Convert.ToInt32(cmbyjks.SelectedValue), InstanceForm.BDatabase); } }
/// <summary> /// 应用程序的主入口点。 /// </summary> private void Frmkcgdcbj_Load(object sender, System.EventArgs e) { CsMydataGrid(this.rdo1.Checked); Yp.AddcmbYjks(cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); if (YpConfig.kslx(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) != DeptType.未知) { cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId; cmbyjks.Enabled = false; } Yp.AddCmbYplx(true, Convert.ToInt32(cmbyjks.SelectedValue), this.cmbyplx, InstanceForm.BDatabase); }
private void cmbyjks_SelectionChangeCommitted(object sender, EventArgs e) { Yp.AddCmbYplx(true, Convert.ToInt32(this.cmbyjks.SelectedValue), this.cmbyplx, InstanceForm.BDatabase); Yp.AddCmbYjks_ck(false, Convert.ToInt32(cmbyjks.SelectedValue), cmbck, InstanceForm.BDatabase); if (cmbck.Items.Count == 0) { cmbck.Visible = false; lblck.Visible = false; } else { cmbck.Visible = true; lblck.Visible = true; } }
/// <summary> /// 应用程序的主入口点。 /// </summary> private void Frmxspm_Load(object sender, System.EventArgs e) { try { dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); //初始化 FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); Yp.AddcmbYear(InstanceForm.BCurrentDept.DeptId, this.cmbyear, InstanceForm.BDatabase); } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
//private bool bpcgl = false;//是否进行批次管理 public Frmtitle(MenuTag menuTag, string chineseName, Form mdiParent) { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); _menuTag = menuTag; _chineseName = chineseName; _mdiParent = mdiParent; this.Text = _chineseName; this.Text = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]"; Yp.AddcmbCk(true, InstanceForm.BCurrentDept.DeptId, cmbck, InstanceForm.BDatabase); // // TODO: 在 InitializeComponent 调用后添加任何构造函数代码 // }
/// <summary> /// 应用程序的主入口点。 /// </summary> private void Frmxspm_Load(object sender, System.EventArgs e) { try { dtp1.Value = Convert.ToDateTime(DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 00:00:00"); dtp2.Value = Convert.ToDateTime(DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToShortDateString() + " 23:59:59"); //初始化 //FunBase.CsDataGrid(this.myDataGrid1,this.myDataGrid1.TableStyles[0],"Tb"); Yp.AddCmbYjks(false, InstanceForm.BCurrentDept.DeptId, cmbyjks, InstanceForm.BDatabase); } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
private static void AddcmbYjks(System.Windows.Forms.ComboBox cmb, string kslx) { string ssql = ""; if (Yp.SelectYjks(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase).Rows.Count == 0) { ssql = " select '全部' KSMC,0 DEPTID union select KSMC,DEPTID from yp_yjks a where qybz=1 and a.kslx='" + kslx.Trim() + "' "; } else { ssql = "select KSMC,DEPTID from yp_yjks a where deptid=" + InstanceForm.BCurrentDept.DeptId + " "; } DataTable tb = InstanceForm.BDatabase.GetDataTable(ssql); cmb.DataSource = tb; cmb.ValueMember = "DEPTID"; cmb.DisplayMember = "KSMC"; }
private void Frmsccj_Load(object sender, System.EventArgs e) { try { //初始化 DataTable myTb = new DataTable(); for (int i = 0; i <= this.myDataGrid1.TableStyles[0].GridColumnStyles.Count - 1; i++) { if (this.myDataGrid1.TableStyles[0].GridColumnStyles[i].GetType().ToString() == "System.Windows.Forms.DataGridBoolColumn") { myTb.Columns.Add(this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText, Type.GetType("System.Int16")); } else { myTb.Columns.Add(this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText, Type.GetType("System.String")); } this.myDataGrid1.TableStyles[0].GridColumnStyles[i].MappingName = this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText; this.myDataGrid1.TableStyles[0].GridColumnStyles[i].NullText = ""; } this.myDataGrid1.DataSource = myTb; this.myDataGrid1.TableStyles[0].MappingName = "Tb"; if (_menuTag.Function_Name == "Fun_ts_yp_xtwh_kcsxx") { Yp.AddcmbYjks(cmbyjks, DeptType.药库, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); } else { Yp.AddcmbYjks(cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); } if (InstanceForm.BCurrentUser.IsAdministrator == false) { cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId; cmbyjks.Enabled = false; } } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
//初始药品 private void csyp(int ggid, int cjid) { try { Ypgg ydgg = new Ypgg(ggid, InstanceForm.BDatabase); this.lblypmc.Tag = ydgg.GGID.ToString(); this.lblypmc.Text = ydgg.YPPM; this.lblypspm.Text = ydgg.YPSPM; this.lblgg.Text = ydgg.YPGG; //this.lblcj.Text=ydcj.S_SCCJ; //this.lblhh.Text=ydcj.SHH; //this.lbllsj.Text=ydcj.LSJ.ToString() ; this.lbldw.Text = Yp.SeekYpdw(ydgg.YPDW, InstanceForm.BDatabase); } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
//是否自动分配批号库存 public static bool BfpKcph(string ywlx, int deptid, RelationalDatabase db) { string t_kcmx = Yp.Seek_kcmx_table(Convert.ToInt32(deptid), db); string ssql = ""; bool temp = false; if (t_kcmx.Trim() == "yk_kcmx") { ssql = string.Format(" select ywfx from yk_ywlx where ywlx='{0}' ", ywlx); DataTable tb = new DataTable(); tb = db.GetDataTable(ssql); if (tb.Rows.Count > 0) { if (Convertor.IsNull(tb.Rows[0][0], "-") == "-") { temp = true; } } } if (t_kcmx.Trim() == "yf_kcmx") { ssql = string.Format(" select ywfx from yf_ywlx where ywlx='{0}' ", ywlx); DataTable tb = new DataTable(); tb = db.GetDataTable(ssql); if (tb.Rows.Count > 0) { if (Convertor.IsNull(tb.Rows[0][0], "-") == "-") { temp = true; } } } SystemCfg config8050 = new SystemCfg(8050); if (config8050.Config == "1" && temp) //启用自动分配批号库存 且 业务方向为出库 { return(true); } else { return(false); } }
private void Frmxspm_Load(object sender, System.EventArgs e) { try { dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); DataTable tbks = InstanceForm.BDatabase.GetDataTable(Yp.Seek_WLDW(_menuTag.Function_Name, InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase)); cmbks.DataSource = tbks; cmbks.ValueMember = "DEPT_ID"; cmbks.DisplayMember = "NAME"; } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
private void Frmgqyptj_Load(object sender, EventArgs e) { try { Yp.AddcmbYjks(cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm); cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId; if (cmbyjks.SelectedIndex < 0) { cmbyjks.Text = "全部"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 应用程序的主入口点。 /// </summary> private void Frmxspm_Load(object sender, System.EventArgs e) { try { dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); //初始化 FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb"); Yp.AddCmbYjks(false, InstanceForm.BCurrentDept.DeptId, cmbyjks, InstanceForm.BDatabase); Yp.AddCmbYplx(true, Convert.ToInt32(cmbyjks.SelectedValue), cmbyplx, InstanceForm.BDatabase); cmbypsx.SelectedIndex = 0; } catch (System.Exception err) { MessageBox.Show("发生错误" + err.Message); } }
private void Frmtitle_Load(object sender, System.EventArgs e) { this.dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); this.dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase); //初始化 DataTable myTb = new DataTable(); myTb.TableName = "Tb"; for (int i = 0; i <= this.myDataGrid1.TableStyles[0].GridColumnStyles.Count - 1; i++) { if (this.myDataGrid1.TableStyles[0].GridColumnStyles[i].GetType().ToString() == "System.Windows.Forms.DataGridBoolColumn") { myTb.Columns.Add(this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText, Type.GetType("System.Int16")); } else { myTb.Columns.Add(this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText, Type.GetType("System.String")); } this.myDataGrid1.TableStyles[0].GridColumnStyles[i].MappingName = this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText; this.myDataGrid1.TableStyles[0].GridColumnStyles[i].NullText = ""; } this.myDataGrid1.DataSource = myTb; this.myDataGrid1.TableStyles[0].MappingName = "Tb"; Yp.AddcmbCk(true, InstanceForm.BCurrentDept.DeptId, cmbck, InstanceForm.BDatabase); if (_menuTag.Function_Name == "Fun_ts_yf_cgjh" && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == true) { butnew.Enabled = false; butsh.Enabled = false; butdel.Enabled = false; } if (_menuTag.Function_Name == "Fun_ts_yk_cgjh" && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == false) { butnew.Enabled = false; butsh.Enabled = false; butdel.Enabled = false; } }