Exemple #1
0
        /// <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(true, cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm);

                if (YpConfig.kslx(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) != DeptType.未知)
                {
                    cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId;
                    cmbyjks.Enabled       = false;
                }
                else
                {
                    cmbyjks.SelectedIndex = 0;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #2
0
        public Frmqykccx(MenuTag menuTag, string chineseName, Form mdiParent)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            _menuTag     = menuTag;
            _chineseName = chineseName;
            _mdiParent   = mdiParent;
            this.Text    = chineseName;
            this.Text    = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]";
            ss           = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);
            if (ss.网络内容显示商品名 == true)
            {
                this.商品名.Width = 110;
            }
            else
            {
                this.商品名.Width = 0;
            }

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Exemple #3
0
        public Frmyedj_mx(MenuTag menuTag, string chineseName, Form mdiParent)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            _menuTag     = menuTag;
            _chineseName = chineseName;
            _mdiParent   = mdiParent;
            this.Text    = _chineseName;
            this.Text    = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]";
            s            = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);
            if (YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == true)
            {
                _Table = "vi_yk_dj";
            }
            else
            {
                _Table = "vi_yf_dj";
            }

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Exemple #4
0
        /// <summary>
        /// 窗体LOAD事件,初始化日期,和网格
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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);


            if ((_menuTag.Function_Name == "Fun_ts_yk_cgrk_yf" || InstanceForm._menuTag.Function_Name == "Fun_ts_yk_cgrk_th_yf" || _menuTag.Function_Name == "Fun_ts_yk_cgrk_yf_cx" || InstanceForm._menuTag.Function_Name == "Fun_ts_yk_cgrk_th_yf_cx") && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == true)
            {
                butnew.Enabled = false;
                butsh.Enabled  = false;
            }

            if ((_menuTag.Function_Name == "Fun_ts_yk_cgrk" || InstanceForm._menuTag.Function_Name == "Fun_ts_yk_cgrk_th" || _menuTag.Function_Name == "Fun_ts_yk_cgrk_cx" || InstanceForm._menuTag.Function_Name == "Fun_ts_yk_cgrk_th_cx") && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == false)
            {
                butnew.Enabled = false;
                butsh.Enabled  = false;
            }

            if (_menuTag.Function_Name == "Fun_ts_yk_cgrk_yf_cx" || InstanceForm._menuTag.Function_Name == "Fun_ts_yk_cgrk_th_yf_cx" ||
                _menuTag.Function_Name == "Fun_ts_yk_cgrk_cx" || InstanceForm._menuTag.Function_Name == "Fun_ts_yk_cgrk_th_cx")
            {
                butnew.Visible = false;
            }

            YpConfig ss = new YpConfig(Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")), InstanceForm.BDatabase);

            if (ss.采购入库单显示批发价和批发金额 == true)
            {
                dataGridTextBoxColumn19.Width = 60;
            }
        }
Exemple #5
0
        private void FrmYfGzlTj_Load(object sender, EventArgs e)
        {
            try
            {
                DateTime dt = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase);
                dtp1.Value = dt.AddDays((1 - dt.Day));
                dtp2.Value = dt.AddDays((1 - dt.Day)).AddMonths(1).AddDays(-1);
                //初始化
                FunBase.CsDataGrid(this.myDataGrid1, this.myDataGrid1.TableStyles[0], "Tb");

                //Yp.AddcmbYear(InstanceForm.BCurrentDept.DeptId, this.cmbypzlx, InstanceForm.BDatabase);
                //Yp.AddCmbYplx(true,InstanceForm.BCurrentDept.DeptId,cmbyplx, InstanceForm.BDatabase);
                //this.rdo1.Checked = true;

                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;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #6
0
        public Frmxd(MenuTag menuTag, string chineseName, Form mdiParent)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            _menuTag     = menuTag;
            _chineseName = chineseName;
            _mdiParent   = mdiParent;
            if (_menuTag.Function_Name == "Fun_ts_yp_pdlr_sczcb" || _menuTag.Function_Name == "Fun_ts_yp_pdlr_sczcb_yf")
            {
                rdozy.Visible    = false;
                rdozy.Checked    = false;
                rdobegin.Enabled = true;
                butup.Enabled    = false;
                butdown.Enabled  = false;
            }
            else
            {
                rdozy.Visible         = true;
                rdozy.Enabled         = true;
                rdozy.Checked         = true;
                dataGridView1.Enabled = false;
                butsc.Visible         = false;
                butusc.Visible        = false;
            }
            this.Text = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]";

            ypconfig = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Exemple #7
0
        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");


            if (_menuTag.Function_Name == "Fun_ts_yp_pd_yf" && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == true)
            {
                butnew.Enabled = false;
                butsh.Enabled  = false;
            }

            if (_menuTag.Function_Name == "Fun_ts_yp_pd" && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == false)
            {
                butnew.Enabled = false;
                butsh.Enabled  = false;
            }

            if (_menuTag.Function_Name == "Fun_ts_yp_pd_yf_cx" || _menuTag.Function_Name == "Fun_ts_yp_pd_cx")
            {
                butnew.Visible = false;
            }
        }
Exemple #8
0
        private void Frmyfckmx_Load(object sender, EventArgs e)
        {
            try
            {
                this.WindowState = FormWindowState.Maximized;
                //dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase);
                //dtp2.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase);
                //this.rdo1.Checked = true;
                radioButton1.Checked = true;
                Yp.AddcmbYjks(true, cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm);
                if (YpConfig.kslx(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) != DeptType.未知)
                {
                    cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId;
                    cmbyjks.Enabled       = false;
                }

                cmbyear.Items.AddRange(new object[] { DateTime.Now.Year, DateTime.Now.AddYears(-1).Year });
                cmbmonth.Items.AddRange(new object[]
                {
                    "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"
                });
                cmbyear.Text  = DateTime.Now.Year.ToString();
                cmbmonth.Text = DateTime.Now.Month.ToString();
                //Yp.AddcmbYear(Convert.ToInt32(cmbyjks.SelectedValue), cmbyear, InstanceForm.BDatabase);
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #9
0
 public FrmZyMzJyCx(MenuTag menuTag, string chineseName, Form mdiParent)
 {
     InitializeComponent();
     _menuTag     = menuTag;
     _chineseName = chineseName;
     _mdiParent   = mdiParent;
     this.Text    = chineseName;
     this.Text    = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]";
     ss           = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);
 }
Exemple #10
0
        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;
        }
Exemple #11
0
        private void butnew_Click(object sender, System.EventArgs e)
        {
            if (YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == true)
            {
                MessageBox.Show("您的登陆科室是药库,但进入了药房系统", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Frmypptrk f     = new Frmypptrk(_menuTag, _chineseName, _mdiParent);
            Point     point = new Point(160, 75);

            f.Location  = point;
            f.MdiParent = _mdiParent;
            f.Show();
        }
Exemple #12
0
        private void FunctionControlEnable(string functionName)
        {
            YpConfig s = new YpConfig(Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")), InstanceForm.BDatabase);

            switch (functionName)
            {
            case "Fun_ts_yk_ypptrk_qc":
            case "Fun_ts_yk_ypptrk_qc_cx":
                rdo1.Visible    = false;
                rdo2.Visible    = false;
                rdo2.Checked    = true;
                chkghdw.Visible = false;
                txtghdw.Visible = false;
                this.药房名称.Width = 0;
                this.审核时间.Width = 0;
                this.审核员.Width  = 0;
                break;

            case "Fun_ts_yk_ypptrk_qtrk":
            case "Fun_ts_yk_ypptrk_qtrk_cx":
                rdo1.Visible         = false;
                rdo2.Visible         = false;
                rdo2.Checked         = true;
                this.药房名称.HeaderText = "供货单位";
                break;

            case "Fun_ts_yk_ypptrk_tk":
            case "Fun_ts_yk_ypptrk_tk_cx":
                chkghdw.Text        = "药房名称";
                this.butnew.Visible = s.业务单据接受方是否可以手工办理单据;
                break;

            case "Fun_ts_yk_ypptrk_drk":
            case "Fun_ts_yk_ypptrk_drk_cx":
                chkghdw.Text        = "药库名称";
                this.butnew.Visible = s.业务单据接受方是否可以手工办理单据;
                break;

            default:
                break;
            }

            if (_menuTag.Function_Name == "Fun_ts_yk_ypptrk_qc_cx" || _menuTag.Function_Name == "Fun_ts_yk_ypptrk_tk_cx" ||
                _menuTag.Function_Name == "Fun_ts_yk_ypptrk_qtrk_cx" || _menuTag.Function_Name == "Fun_ts_yk_ypptrk_drk_cx")
            {
                butnew.Visible = false;
            }
        }
Exemple #13
0
        public Frmtjmx(MenuTag menuTag, string chineseName, Form mdiParent)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            _menuTag     = menuTag;
            _chineseName = chineseName;
            _mdiParent   = mdiParent;
            this.Text    = _chineseName;
            s            = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Exemple #14
0
        public FrmOptionData(MenuTag menuTag, string chineseName, Form mdiParent)
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            _menuTag     = menuTag;
            _chineseName = chineseName;
            _mdiParent   = mdiParent;
            Yp.AddcmbCk(false, InstanceForm.BCurrentDept.DeptId, cmbck, InstanceForm.BDatabase);

            this.Text = this.Text + " [" + InstanceForm._menuTag.Jgbm + "]";
            ypconfig  = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }
Exemple #15
0
        private void Frmxd_Load(object sender, System.EventArgs e)
        {
            cmbmb.Enabled = false;
            //添加模板
            YP_PDMB.AddCmbMb(InstanceForm.BCurrentDept.DeptId, cmbmb, InstanceForm.BDatabase);


            //判断是否已开始盘存
            if (BegionPd() == true)
            {
                //this.rdobegin.Enabled = false;
                //this.cmbmb.Enabled = true;
                //this.rdomb.Enabled = true;
                //this.rdomb.Checked = true;
                //this.rdozy.Enabled = true;
                //this.chkdel.Visible=true;
            }
            //else
            //{
            //this.rdobegin.Enabled=true;
            //this.rdobegin.Checked=true;
            //this.cmbmb.Enabled=false;
            //this.rdomb.Enabled=false;
            //this.rdozy.Enabled=false;
            //this.rdozy.Enabled = true;
            //this.chkdel.Visible=false;
            //}


            if (_menuTag.Function_Name == "Fun_ts_yp_pdlr_sczcb_yf" && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == true)
            {
                butsc.Enabled   = false;
                butusc.Enabled  = false;
                butdown.Enabled = false;
            }

            if (_menuTag.Function_Name == "Fun_ts_yp_pdlr_sczcb" && YpConfig.是否药库(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) == false)
            {
                butsc.Enabled   = false;
                butusc.Enabled  = false;
                butdown.Enabled = false;
            }
            int deptid = InstanceForm.BCurrentDept.DeptId;
        }
Exemple #16
0
        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;
            }
        }
Exemple #17
0
        private void FrmJyxsHZtj_Load(object sender, EventArgs e)
        {
            try
            {
                Yp.AddcmbYjks(true, 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);

                cmbypsx.SelectedIndex = 10;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #18
0
        private void Frmxspm_Load(object sender, System.EventArgs e)
        {
            try
            {
                dtp1.Value = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase);
                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, typeof(bool));
                    }
                    else
                    {
                        myTb.Columns.Add(this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText, Type.GetType("System.String"));
                    }

                    this.myDataGrid1.TableStyles[0].GridColumnStyles[i].NullText    = "";
                    this.myDataGrid1.TableStyles[0].GridColumnStyles[i].MappingName = this.myDataGrid1.TableStyles[0].GridColumnStyles[i].HeaderText;
                }
                this.myDataGrid1.DataSource = myTb;
                this.myDataGrid1.TableStyles[0].MappingName = "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;
                }
                Yp.AddCmbYplx(true, Convert.ToInt32(cmbyjks.SelectedValue), this.cmbyplx, InstanceForm.BDatabase);
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #19
0
        private void Xspm_kss_Load(object sender, EventArgs e)
        {
            try
            {
                Yp.AddcmbYjks(true, 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);

                cmbypsx.SelectedIndex = 10;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            //this.dtp2.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            this.dtp1.Text = DateTime.Now.ToString("yyyy-MM-") + "01";
        }
Exemple #20
0
        private void ComputeCf()
        {
            string[] GroupbyField = { "处方号" };
            string[] ComputeField = { };
            string[] CField       = { };

            DataTable tb = (DataTable)this.myDataGrid1.DataSource;
            DataTable tab;

            DataRow[] selrow = tb.Select("发药='◆' and cjid<>''");
            //DataRow[] selrow=tb.Select("发药='◆' and cjid<>'' and charge_bit='1'");
            DataTable tbsel = tb.Clone();

            for (int w = 0; w <= selrow.Length - 1; w++)
            {
                tbsel.ImportRow(selrow[w]);
            }
            tab = FunBase.GroupbyDataTable(tbsel, GroupbyField, ComputeField, CField, null);
            //this.lblbz.Text = "处方数:" + tab.Rows.Count.ToString() + " 张";

            string[]  GroupbyField1 = { "dept_ly" };
            string[]  ComputeField1 = { };
            string[]  CField1       = { };
            DataTable tbsel1        = tb.Clone();

            for (int w = 0; w <= selrow.Length - 1; w++)
            {
                tbsel1.ImportRow(selrow[w]);
            }
            tab = FunBase.GroupbyDataTable(tbsel1, GroupbyField1, ComputeField1, CField1, null);
            string ss = "";

            for (int i = 0; i <= tab.Rows.Count - 1; i++)
            {
                ss = ss + " " + Yp.SeekDeptName(Convert.ToInt32(tab.Rows[i]["dept_ly"]), InstanceForm.BDatabase);
            }
            //this.lblbz.Text = lblbz.Text + " 科室:" + ss.ToString();
        }
Exemple #21
0
        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.AddcmbYear(InstanceForm.BCurrentDept.DeptId, this.cmbypzlx, InstanceForm.BDatabase);

            this.rdo1.Checked = true;

//			Yp.AddCmbYplx(true,InstanceForm.BCurrentDept.DeptId,this.cmbyplx,InstanceForm.BDatabase);

            Yp.AddcmbYjks(true, 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.AddcmbYear(Convert.ToInt32(cmbyjks.SelectedValue), cmbyear, InstanceForm.BDatabase);

            s = new YpConfig(Convert.ToInt32(cmbyjks.SelectedValue), InstanceForm.BDatabase);
        }
Exemple #22
0
        private void Frmgqyptj_Load(object sender, EventArgs e)
        {
            try
            {
                Yp.AddcmbYjks(cmbyjks, DeptType.药房, InstanceForm.BDatabase, InstanceForm._menuTag.Jgbm);

                if (YpConfig.kslx(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase) != DeptType.未知)
                {
                    cmbyjks.SelectedValue = InstanceForm.BCurrentDept.DeptId;

                    if (cmbyjks.SelectedIndex < 0)
                    {
                        cmbyjks.Text = "全部";
                    }
                }

                cmbyjks.Enabled = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #23
0
        private void FunctionControlEnable(string functionName)
        {
            YpConfig s = new YpConfig(InstanceForm.BCurrentDept.DeptId, InstanceForm.BDatabase);

            switch (functionName)
            {
            case "Fun_ts_yf_ypptrk_qc":
                rdo1.Visible    = false;
                rdo2.Visible    = false;
                rdo2.Checked    = true;
                chkghdw.Visible = false;
                txtghdw.Visible = false;
                this.供货单位.Width = 0; this.审核时间.Width = 0; this.审核员.Width = 0;
                break;

            case "Fun_ts_yf_ypptrk_sh":
                this.butnew.Visible = s.业务单据接受方是否可以手工办理单据;
                break;

            case "Fun_ts_yf_ypptrk_drd":
                this.butnew.Visible = s.业务单据接受方是否可以手工办理单据;
                break;

            case "Fun_ts_yf_ypptrk_qtrk":
                rdo1.Visible = false;
                rdo2.Visible = false;
                rdo2.Checked = true;
                break;

            case "Fun_ts_yf_ypptrk_xygrk":
                this.butnew.Visible = s.业务单据接受方是否可以手工办理单据;
                break;

            default:
                break;
            }
        }
Exemple #24
0
        private void butsh_Click(object sender, System.EventArgs e)
        {
            try
            {
                int       nrow = this.myDataGrid1.CurrentCell.RowNumber;
                DataTable tb   = (DataTable)this.myDataGrid1.DataSource;
                ypconfig = new YpConfig(Convert.ToInt32(Convertor.IsNull(cmbck.SelectedValue, "0")), InstanceForm.BDatabase);

                if (tb.Rows.Count == 0)
                {
                    return;
                }
                if (ypconfig.盘存方式 == "0")
                {
                    Frmzylr f     = new Frmzylr(_menuTag, _chineseName, _mdiParent);
                    Point   point = new Point(160, 75);
                    f.Location  = point;
                    f.MdiParent = _mdiParent;
                    f.Show();
                    f.FillDj(new Guid(tb.Rows[nrow]["id"].ToString()), this.rdo2.Checked);
                }
                else
                {
                    Frmzylr_kcmx f     = new Frmzylr_kcmx(_menuTag, _chineseName, _mdiParent);
                    Point        point = new Point(160, 75);
                    f.Location  = point;
                    f.MdiParent = _mdiParent;
                    f.Show();
                    f.FillDj(new Guid(tb.Rows[nrow]["id"].ToString()), this.rdo2.Checked);
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #25
0
        private void butprint_Click(object sender, System.EventArgs e)
        {
            string where1 = "";

            // if (cmbck.Visible == true) where1 = "仓库名称:" + cmbck.Text.Trim();
            if (rdo1.Checked == true)
            {
                where1 = "按日期统计  日期:" + dtp1.Value.ToShortDateString();
                where1 = where1 + " 到:" + dtp2.Value.ToShortDateString();
            }
            else
            {
                where1 = "按会计月份统计  日期:" + this.statusBar1.Panels[3].Text;
            }


            try
            {
                YpConfig  s  = new YpConfig(Convert.ToInt32(cmbyjks.SelectedValue), InstanceForm.BDatabase);
                DataTable tb = (DataTable)this.myDataGrid1.DataSource;
                ts_Yk_ReportView.Dataset1 Dset = new ts_Yk_ReportView.Dataset1();
                DataRow myrow;
                for (int i = 0; i <= tb.Rows.Count - 2; i++)
                {
                    myrow       = Dset.报损报溢单.NewRow();
                    myrow["xh"] = Convert.ToInt32(tb.Rows[i]["序号"]);
                    if (s.打印单据时单据显示商品名 == true)
                    {
                        myrow["ypmc"] = Convert.ToString(tb.Rows[i]["商品名"]);
                    }
                    else
                    {
                        myrow["ypmc"] = Convert.ToString(tb.Rows[i]["品名"]);
                    }
                    myrow["ypgg"] = Convert.ToString(tb.Rows[i]["规格"]);
                    myrow["sccj"] = Convert.ToString(tb.Rows[i]["厂家"]);
                    myrow["ypsl"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["数量"], "0"));
                    myrow["ypdw"] = Convert.ToString(tb.Rows[i]["单位"]);
                    myrow["pfj"]  = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["批发价"], "0"));
                    myrow["pfje"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["批发金额"], "0"));
                    myrow["lsj"]  = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["零售价"], "0"));
                    myrow["lsje"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["零售金额"], "0"));
                    decimal plce = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["零售金额"], "0")) - Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["批发金额"], "0"));
                    myrow["plce"] = plce.ToString("0.00");

                    myrow["jhj"]  = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["进价"], "0"));
                    myrow["jhje"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["进货金额"], "0"));
                    decimal jlce = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["零售金额"], "0")) - Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["进货金额"], "0"));
                    myrow["jlce"] = jlce.ToString("0.00");

                    myrow["ypph"] = Convert.ToString(tb.Rows[i]["批号"]);
                    myrow["ypxq"] = Convert.ToString(tb.Rows[i]["效期"]);
                    myrow["shh"]  = Convert.ToString(tb.Rows[i]["货号"]);
                    myrow["kwmc"] = "";                  //Convert.ToString(tb.Rows[i]["库位"]);
                    Dset.报损报溢单.Rows.Add(myrow);
                }

                string        title      = _menuTag.Function_Name.Trim() == "Fun_ts_yk_tjbb_bshz" ? "药品报损汇总统计" : "药品报溢汇总统计";
                ParameterEx[] parameters = new ParameterEx[9];
                parameters[0].Text  = "DJH";
                parameters[0].Value = "";              //this.lbldjh.Text;
                parameters[1].Text  = "DJY";
                parameters[1].Value = InstanceForm.BCurrentUser.Name;
                parameters[2].Text  = "BSBYYY";
                parameters[2].Value = "";              //txtyy.Text.Trim();
                parameters[3].Text  = "RQ";
                parameters[3].Value = "";              //dtprq.Value.ToShortDateString();
                parameters[4].Text  = "TITLETEXT";
                parameters[4].Value = TrasenFrame.Classes.Constant.HospitalName + "(" + cmbyjks.Text.Trim() + ")" + title.Trim();
                parameters[5].Text  = "BZ";
                parameters[5].Value = "";              //txtbz.Text.Trim();
                parameters[6].Text  = "ybps";
                parameters[6].Value = "";
                parameters[7].Text  = "swhere";
                parameters[7].Value = where1.Trim();
                parameters[8].Text  = "ckmc";
                parameters[8].Value = cmbck.Text;
                TrasenFrame.Forms.FrmReportView f = new TrasenFrame.Forms.FrmReportView(Dset.报损报溢单, Constant.ApplicationDirectory + "\\Report\\YK_药品报损报溢单.rpt", parameters);
                if (f.LoadReportSuccess)
                {
                    f.Show();
                }
                else
                {
                    f.Dispose();
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
Exemple #26
0
        private void butprint_Click(object sender, System.EventArgs e)
        {
            string where1 = "";

            if (rdo1.Checked == true)
            {
                where1 = where1 + "按日期统计  日期:" + dtp1.Value.ToShortDateString();
                where1 = where1 + " 到:" + dtp2.Value.ToShortDateString();
            }
            else
            {
                where1 = where1 + "按会计月份统计  日期:" + this.statusBar1.Panels[3].Text;
            }

            try
            {
                YpConfig ss = new YpConfig(Convert.ToInt32(cmbyjks.SelectedValue), InstanceForm.BDatabase);
                this.Cursor = PubStaticFun.WaitCursor();
                DataTable tb = (DataTable)this.myDataGrid1.DataSource;
                ts_Yk_ReportView.Dataset2 Dset = new ts_Yk_ReportView.Dataset2();
                DataRow myrow;
                decimal pcjhje = 0;
                decimal ykjhje = 0;
                for (int i = 0; i <= tb.Rows.Count - 2; i++)
                {
                    myrow       = Dset.药品盘点单.NewRow();
                    myrow["xh"] = Convert.ToInt32(tb.Rows[i]["序号"]);
                    if (ss.打印单据时单据显示商品名 == true)
                    {
                        myrow["ypmc"] = Convert.ToString(tb.Rows[i]["商品名"]);
                    }
                    else
                    {
                        myrow["ypmc"] = Convert.ToString(tb.Rows[i]["品名"]);
                    }
                    myrow["ypgg"] = Convert.ToString(tb.Rows[i]["规格"]);
                    myrow["sccj"] = Convert.ToString(tb.Rows[i]["厂家"]);
                    myrow["ypdw"] = Convert.ToString(tb.Rows[i]["单位"]);
                    myrow["pfj"]  = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["批发价"], "0"));
                    myrow["lsj"]  = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["零售价"], "0"));
                    myrow["zcsl"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["帐存数量"], "0"));
                    myrow["zcje"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["帐存金额"], "0"));
                    myrow["pcsl"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["盘存数量"], "0"));
                    myrow["pcje"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["盘存金额"], "0"));
                    myrow["yksl"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["盈亏数量"], "0"));
                    myrow["ykje"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["盈亏金额"], "0"));

                    myrow["jhj"] = Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["进价"], "0"));
                    pcjhje       = pcjhje + Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["进价"], "0")) * Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["盘存数量"], "0"));
                    ykjhje       = ykjhje + Convert.ToDecimal(Convertor.IsNull(tb.Rows[i]["进货金额盈亏"], "0"));


                    myrow["ypph"] = Convert.ToString(tb.Rows[i]["批号"]);
                    myrow["shh"]  = Convert.ToString(tb.Rows[i]["货号"]);
                    myrow["kwmc"] = "";                          //Convert.ToString(tb.Rows[i]["库位"]);
                    Dset.药品盘点单.Rows.Add(myrow);
                }

                ParameterEx[] parameters = new ParameterEx[10];
                parameters[0].Text  = "DJH";
                parameters[0].Value = "";              //this.lbldjh.Text;
                parameters[1].Text  = "DJY";
                parameters[1].Value = InstanceForm.BCurrentUser.Name;
                parameters[2].Text  = "RQ";
                parameters[2].Value = "";              //dtprq.Text.Trim();
                parameters[3].Text  = "TITLETEXT";
                parameters[3].Value = TrasenFrame.Classes.Constant.HospitalName + "(" + cmbyjks.Text.Trim() + ")" + this.Text;
                parameters[4].Text  = "BZ";
                parameters[4].Value = "";              //txtbz.Text.Trim();
                parameters[5].Text  = "swhere";
                parameters[5].Value = where1.Trim();
                parameters[6].Text  = "YKJHJE";
                parameters[6].Value = Convert.ToDecimal(ykjhje.ToString("0.00"));
                parameters[7].Text  = "PCJHJE";
                parameters[7].Value = Convert.ToDecimal(pcjhje.ToString("0.00"));
                parameters[8].Text  = "ckmc";
                parameters[8].Value = cmbck.Text.Trim();
                parameters[9].Text  = "dyr";
                parameters[9].Value = InstanceForm.BCurrentUser.Name;


                TrasenFrame.Forms.FrmReportView f = new TrasenFrame.Forms.FrmReportView(Dset.药品盘点单, Constant.ApplicationDirectory + "\\Report\\YF_药品盘点单据.rpt", parameters);
                if (f.LoadReportSuccess)
                {
                    f.Show();
                }
                else
                {
                    f.Dispose();
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message);
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }
Exemple #27
0
        private void butsc_Click(object sender, EventArgs e)
        {
            //当前科室名称
            string deptname = InstanceForm.BCurrentDept.DeptName.Trim();
            //日期
            string sDate = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToString();

            #region 权限确认
            try
            {
                string dlgvalue = DlgPW.Show();
                string pwStr    = dlgvalue; //YS.Password;
                bool   bOk      = InstanceForm.BCurrentUser.CheckPassword(pwStr);
                if (!bOk)
                {
                    FrmMessageBox.Show("你没有通过权限确认!", new Font("宋体", 12f), Color.Red, "Sorry!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    Cursor = Cursors.Default;
                    return;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            #endregion

            string    sql = string.Format(@"  select ID,b.YWMC from YK_DJ_TEMP a left join YK_YWLX b on a.YWLX = b.YWLX  where a.SHBZ !=1 and a.DEPTID ={0}
            union select ID,b.YWMC from YK_DJ a left join YK_YWLX b on a.YWLX = b.YWLX  where a.SHBZ !=1 and a.DEPTID ={0}", InstanceForm.BCurrentDept.DeptId);
            DataTable dt  = InstanceForm.BDatabase.GetDataTable(sql);
            if (dt != null && dt.Rows.Count > 0)
            {
                string ywmc = string.Empty;
                foreach (DataRow tmpRow in dt.Rows)
                {
                    if (!ywmc.Contains(tmpRow[1].ToString().Trim()))
                    {
                        ywmc += tmpRow[1].ToString().Trim() + ",";
                    }
                }
                ywmc = ywmc.Remove(ywmc.Length - 1, 1);
                ywmc = ywmc[ywmc.Length - 1].ToString().Trim() == "单" ? ywmc : ywmc + "单据";
                MessageBox.Show(string.Format("存在未审核的{0},请处理!", ywmc));
                return;
            }

            sql = string.Format(@"select a.ID,B.YWMC from YF_DJ a left join Yf_YWLX b on a.YWLX = b.YWLX where (a.YWLX = '016' or a.YWLX = '015') and a.SHBZ !=1 and a.DEPTID ={0} ", InstanceForm.BCurrentDept.DeptId);
            dt  = InstanceForm.BDatabase.GetDataTable(sql);
            if (dt != null && dt.Rows.Count > 0)
            {
                string ywmc = string.Empty;
                foreach (DataRow tmpRow in dt.Rows)
                {
                    if (!ywmc.Contains(tmpRow[1].ToString().Trim()))
                    {
                        ywmc += tmpRow[1].ToString().Trim() + ",";
                    }
                }
                ywmc = ywmc.Remove(ywmc.Length - 1, 1);
                ywmc = ywmc[ywmc.Length - 1].ToString().Trim() == "单" ? ywmc : ywmc + "单据";
                MessageBox.Show(string.Format("存在未审核的{0},请处理!", ywmc));
                return;
            }

            if (_menuTag.Function_Name == "Fun_ts_yp_pdlr_sczcb_yf")
            {
                #region   发药明细表的数据
                string stext = this.Text.Trim();
                //上传发药明细表的数据
                this.Cursor = Cursors.WaitCursor;
                this.Text   = "正在上传处方发药明细.....";

                try
                {
                    this.Cursor = PubStaticFun.WaitCursor();
                    int    err_code = -1;
                    string err_text = "";

                    InstanceForm.BDatabase.BeginTransaction();

                    ParameterEx[] parameters = new ParameterEx[8];
                    parameters[0].Text  = "@djrq";
                    parameters[0].Value = Convert.ToDateTime(sDate).ToShortDateString();

                    parameters[1].Text  = "@djsj";
                    parameters[1].Value = Convert.ToDateTime(sDate).ToLongTimeString();

                    parameters[2].Text  = "@djy";
                    parameters[2].Value = InstanceForm.BCurrentUser.EmployeeId;

                    parameters[3].Text  = "@deptid";
                    parameters[3].Value = InstanceForm.BCurrentDept.DeptId;

                    parameters[4].Text  = "@endrq";
                    parameters[4].Value = Convert.ToDateTime(sDate).ToShortDateString();

                    parameters[5].Text          = "@err_code";
                    parameters[5].ParaDirection = ParameterDirection.Output;
                    parameters[5].DataType      = System.Data.DbType.Int32;
                    parameters[5].ParaSize      = 100;

                    parameters[6].Text          = "@err_text";
                    parameters[6].ParaDirection = ParameterDirection.Output;
                    parameters[6].ParaSize      = 100;

                    parameters[7].Text  = "@jgbm";
                    parameters[7].Value = InstanceForm._menuTag.Jgbm;


                    InstanceForm.BDatabase.DoCommand("SP_YF_fymx_dj", parameters, 30);
                    err_code = Convert.ToInt32(parameters[5].Value);
                    err_text = Convert.ToString(parameters[6].Value);

                    //更新处方上传日期
                    string rq   = sDate;
                    string ssql = "update yp_yjks set cfscrq='" + rq + "' where deptid=" + InstanceForm.BCurrentDept.DeptId + "";
                    InstanceForm.BDatabase.DoCommand(ssql);


                    InstanceForm.BDatabase.CommitTransaction();

                    this.Text = "上传处方记录成功";
                }
                catch (System.Exception err)
                {
                    InstanceForm.BDatabase.RollbackTransaction();
                    MessageBox.Show("在上传发药明细时发生错误" + err.Message);
                    return;
                }
                finally
                {
                    this.Cursor = Cursors.Arrow;
                }
                #endregion
            }
            #region 系统对账


            //系统对账
            this.Text = "正在进行系统对账.....";
            try
            {
                this.Cursor = PubStaticFun.WaitCursor();

                ParameterEx[] parameters = new ParameterEx[2];
                parameters[0].Text  = "@jsrq";
                parameters[1].Text  = "@deptid";
                parameters[0].Value = sDate; //该参数暂时无用
                parameters[1].Value = InstanceForm.BCurrentDept.DeptId;
                DataTable tb = InstanceForm.BDatabase.GetDataTable("SP_YF_XTDZ", parameters, 60);
                tb.TableName = "myTb";

                DataRow[] row = tb.Select("数量差值<> 0");
                if (row.Length != 0)
                {
                    throw new Exception("系统检测到帐务数据不平,请到 [系统对帐] 菜单重新进行系统对帐后再进行当前操作");
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("出错" + err.Message);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }

            #endregion

            #region 生成帐存表

            if (MessageBox.Show("您确定要生成 [" + deptname + "] 盘点帐存表吗?", "询问窗", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            try
            {
                this.Cursor = TrasenClasses.GeneralClasses.PubStaticFun.WaitCursor();

                DataTable tb = (DataTable)dataGridView1.DataSource;

                sDate = DateManager.ServerDateTimeByDBType(InstanceForm.BDatabase).ToString();

                //插入当前帐面数量到盘点临时表
                InstanceForm.BDatabase.BeginTransaction();

                for (int xxx = 0; xxx <= tb.Rows.Count - 1; xxx++)
                {
                    //仓库id
                    int    deptid      = Convert.ToInt32(tb.Rows[xxx]["deptid"]);
                    string tablename   = "";
                    string tbName_kcmx = "";

                    if (YpConfig.是否药库(deptid, InstanceForm.BDatabase) == true)
                    {
                        tablename   = "yk_kcph";
                        tbName_kcmx = "yk_kcmx";
                    }
                    else
                    {
                        tablename   = "yf_kcph";
                        tbName_kcmx = "yf_kcmx";
                    }

                    string    ssql   = "select kcid ncount,djsj from yf_pdtemp where deptid=" + deptid + " and shbz=0  and bdelete=0 ";
                    DataTable tbtemp = InstanceForm.BDatabase.GetDataTable(ssql);
                    if (tbtemp.Rows.Count > 0)
                    {
                        throw new Exception("[" + deptname + "] 帐存数据已生成,不能再次生成!");
                    }

                    ssql = "insert into yf_pdtemp(id,kcid,jgbm,ggid,cjid,KWID,jhj,ypph,kcl,zxdw,dwbl,djsj,djy,bdelete,deptid,ypxq,yppch)" +
                           "select dbo.FUN_GETGUID(newid(),getdate()),id,jgbm,ggid,cjid,KWID,jhj,ypph,kcl,zxdw,dwbl,'" + sDate + "'," + InstanceForm.BCurrentUser.EmployeeId + ", bdelete,deptid,ypxq,yppch from " + tablename + " where deptid=" + deptid + "";
                    InstanceForm.BDatabase.DoCommand(ssql);
                }

                InstanceForm.BDatabase.CommitTransaction();

                MessageBox.Show("盘点帐存表生成成功,接下来您可以进行盘存单的录入操作", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                bool b = BegionPd();
                return;
            }
            catch (System.Exception err)
            {
                InstanceForm.BDatabase.RollbackTransaction();
                MessageBox.Show(err.Message);
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
            #endregion
        }
Exemple #28
0
        /// <summary>
        /// 根据函数名称实例化窗体
        /// </summary>
        public void InstanceWorkForm()
        {
            if (_functionName == "")
            {
                throw new Exception("引出函数名不能为空!");
            }
            //Frmmzfy Frmmzfy = null;					//★需要调用的窗口类
            switch (_functionName)
            {
            case "Fun_ts_yf_mzfy":
            case "Fun_ts_yf_mzfy_ZCY":
            case "Fun_ts_yf_mzfy_YFFY":
            case "Fun_ts_yf_mzfy_eyf":
//					Frmmzfy=new Frmmzfy(_menuTag,_chineseName,_mdiParent);
//					Frmmzfy.MdiParent=_mdiParent;
//					Frmmzfy.Show();

                //Frmcffy Frmcffy = new Frmcffy(_menuTag, _chineseName, _mdiParent);
                //Frmcffy.MdiParent = _mdiParent;
                //Frmcffy.Show();

                YpConfig s   = new YpConfig(TrasenFrame.Forms.FrmMdiMain.CurrentDept.DeptId, InstanceForm.BDatabase);
                string   add = TrasenClasses.GeneralClasses.PubStaticFun.GetMacAddress();


                DataTable tb = MZYF.Get_fyck(add, "", InstanceForm.BDatabase);
                if (tb.Rows.Count == 0)
                {
                    if (s.配药模式 == true)
                    {
                        Frmpyck f = new Frmpyck(_menuTag, _chineseName, _mdiParent);
                        f.ShowDialog();
                        return;
                    }
                }

                if (tb.Rows.Count > 0)
                {
                    if (tb.Rows[0]["bscbz"].ToString() == "1")
                    {
                        MessageBox.Show("该窗口已被停用,如需使用请重新启用它!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                        if (s.配药模式 == true)
                        {
                            Frmpyck f = new Frmpyck(_menuTag, _chineseName, _mdiParent);
                            f.ShowDialog();
                            return;
                        }
                    }
                }

                string fyckh  = "";
                string fyckmc = "";

                if (tb.Rows.Count != 0)
                {
                    fyckh = tb.Rows[0]["CODE"].ToString().Trim();
                }
                if (tb.Rows.Count != 0)
                {
                    fyckmc = tb.Rows[0]["name"].ToString().Trim();
                }
                Frmcffy Frmcffy = new Frmcffy(_menuTag, _chineseName, _mdiParent);
                Frmcffy._Fyckh  = fyckh.Trim();
                Frmcffy._Fyckmc = fyckmc;
                MZYF.Update_fyck(add, Frmcffy._Fyckh, 1, InstanceForm.BDatabase);
                if (_mdiParent != null)
                {
                    Frmcffy.MdiParent = _mdiParent;
                }
                Frmcffy.Show();



                break;

            case "Fun_ts_yf_SetFyckUse":
                FrmSetFyckUse frm = new FrmSetFyckUse(_menuTag, _chineseName, _mdiParent);
                if (_mdiParent != null)
                {
                    frm.MdiParent = _mdiParent;
                }
                frm.Show();
                break;

            default:
                throw new Exception("引出函数名错误!");
            }
        }