Exemple #1
0
        /// <summary>
        /// 在弹出的界面根据选择的院区进行查询收费员
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtSFY_KeyUp(object sender, KeyEventArgs e)
        {
            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);

                string[] GrdMappingName = new string[] { "EmployeeId", "NAME", "PYM", "WBM", "YQNAME" };
                int[]    GrdWidth       = new int[] { 30, 100, 60, 50, 50 };
                string[] sfield         = new string[] { "a.NAME", "a.Y_CODE", "", "", "" };//此处5个检索条件不要删除

                string ssql    = string.Format(@"select distinct a.Employee_Id AS EmployeeId ,a.NAME AS NAME,a.PY_CODE AS PYM,a.WB_CODE AS WBM,
                    (CASE C.YQID WHEN '1001' THEN '南院' WHEN '1002' THEN '后湖'  WHEN '1003' THEN '花桥'  WHEN '1004' THEN '谌家矶' 
                     WHEN '0' THEN '全院' END) AS YQNAME
                    from 
                    (select Employee_Id,NAME,PY_CODE,WB_CODE 
                    from JC_EMPLOYEE_PROPERTY where EMPLOYEE_ID 
                    in (select Employee_Id from Pub_User where id in (
                    select User_Id from Pub_Group_User where Group_Id =38 or Group_Id =39))
                     ) a
                    left join JC_EMP_DEPT_ROLE b on a.EMPLOYEE_ID = b.EMPLOYEE_ID 
                    left join JC_DEPT_PROPERTY c on b.DEPT_ID = c.DEPT_ID ");
                string strYQID = comboBox1.SelectedValue.ToString();
                if (strYQID != "0")
                {
                    ssql += " WHERE 1=1 AND c.YQID='" + strYQID + "' ";
                }

                TrasenFrame.Forms.Fshowcard f = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.拼音, control.Text.Trim(), ssql);
                f.Location = point;
                f.Text     = "收费员录入";
                f.Width    = 500;
                f.ShowDialog();
                DataRow row = f.dataRow;
                if (row != null)
                {
                    (sender as Control).Tag = row["EmployeeId"].ToString();
                    txtSFY.Text             = row["NAME"].ToString();
                    txtSFY.Tag = row["EmployeeId"].ToString();
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #2
0
        //弹出输入框
        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
            {
                string[] GrdMappingName;
                int[]    GrdWidth;
                string[] sfield;
                string   ssql = "";
                DataRow  row;

                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;
                    }
                    GrdMappingName = new string[] { "id", "行号", "科室", "拼音码", "五笔码" };
                    GrdWidth       = new int[] { 0, 50, 200, 100, 100 };
                    sfield         = new string[] { "wb_code", "py_code", "", "", "" };
                    ssql           = "select  dept_id,0 rowno, name, py_code, wb_code from jc_dept_property where dept_id<>0  and deleted=0  ";
                    TrasenFrame.Forms.Fshowcard f1 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.拼音, control.Text.Trim(), ssql);
                    f1.Location = point;
                    f1.ShowDialog(this);
                    row = f1.dataRow;
                    if (row != null)
                    {
                        lblyk.Text = row["name"].ToString();
                        lblyk.Tag  = row["dept_id"].ToString();
                        AddView3(Convert.ToInt32(Convertor.IsNull(lblyk.Tag, "0")));
                        this.SelectNextControl((Control)sender, true, false, true, true);
                    }
                    break;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #3
0
        //输入框控制事件
        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 == 32 || (nkey == 13 && (Convert.ToString(control.Tag) == "0" || Convert.ToString(control.Tag) == "")))
            {
            }
            else
            {
                return;
            }

            string[] GrdMappingName;
            int[]    GrdWidth;
            string[] sfield;
            string   ssql = "";
            DataRow  row;

            Point point = new Point(this.Location.X + control.Location.X, this.Location.Y + control.Location.Y + control.Height * 3);

            switch (control.TabIndex)
            {
            case 25:
                if (control.Text.Trim() == "")
                {
                    return;
                }
                GrdMappingName = new string[] { "ggid", "cjid", "行号", "品名", "规格", "厂家", "单位", "DWBL", "批发价", "零售价", "货号" };
                GrdWidth       = new int[] { 0, 0, 50, 200, 100, 100, 40, 0, 60, 60, 70 };
                sfield         = new string[] { "wbm", "pym", "szm", "ywm", "ypbm" };
                ssql           = "select a.ggid,cjid,0  rowno,yppm,ypgg,dbo.fun_yp_sccj(sccj) sccj,dbo.fun_yp_ypdw(ypdw) ypdw,1 dwbl,pfj,lsj,shh from vi_Yf_kcmx a,yp_ypbm b where a.ggid=b.ggid and deptid=" + Convert.ToInt32(cmbyjks.SelectedValue) + " ";
                TrasenFrame.Forms.Fshowcard f2 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, Constant.CustomFilterType, control.Text.Trim(), ssql);
                f2.Location = point;
                f2.Width    = 700;
                f2.Height   = 300;
                f2.ShowDialog(this);
                row = f2.dataRow;
                if (row != null)
                {
                    this.txtdm.Text = row["yppm"].ToString();
                    this.txtdm.Tag  = row["cjid"].ToString();
                }
                break;
            }
        }
Exemple #4
0
        /// <summary>
        /// 根据供应商进行自动完成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtGys_KeyDown(object sender, KeyEventArgs e)
        {
            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);

                string[] GrdMappingName       = new string[] { "ID", "GHDWMC", "PYM", "WBM" };
                int[]    GrdWidth             = new int[] { 30, 200, 80, 80 };
                string[] sfield               = new string[] { "PYM", "WBM", "GHDWMC", "", "" };
                string   ssql                 = string.Format(@"select ID,GHDWMC,PYM,WBM  from YP_GHDW where BDELETE=0 ");
                TrasenFrame.Forms.Fshowcard f = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.拼音, control.Text.Trim(), ssql);
                f.Location = point;
                f.Text     = "供应商输入";
                f.Width    = 400;
                f.ShowDialog();
                DataRow row = f.dataRow;
                if (row != null)
                {
                    (sender as Control).Tag = row["id"].ToString();
                    txtGys.Text             = row["GHDWMC"].ToString();
                    txtGys.Tag = row["id"].ToString();
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #5
0
        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 == 32 || (nkey == 13 && (Convert.ToString(control.Tag) == "0" || Convert.ToString(control.Tag) == "")))
            {
            }
            else
            {
                return;
            }

            string[] GrdMappingName;
            int[]    GrdWidth;
            string[] sfield;
            string   ssql = "";
            DataRow  row;
            Point    point = new Point(this.Location.X + control.Location.X, this.Location.Y + control.Location.Y + control.Height * 3);

            switch (control.TabIndex)
            {
            case 6:
                if (control.Text.Trim() == "")
                {
                    return;
                }
                GrdMappingName = new string[] { "ggid", "cjid", "行号", "品名", "规格", "厂家", "单位", "DWBL", "批发价", "零售价", "货号" };
                GrdWidth       = new int[] { 0, 0, 50, 200, 100, 100, 40, 0, 60, 60, 70 };
                sfield         = new string[] { "b.wbm", "b.pym", "szm", "ywm", "ypbm" };
                if (Convertor.IsNull(cmbyjks.SelectedValue, "0") != "0")
                {
                    ssql = "select a.ggid,cjid,0  rowno,yppm,ypgg,dbo.fun_yp_sccj(sccj) sccj,dbo.fun_yp_ypdw(ypdw) ypdw,1 dwbl,pfj,lsj,shh from vi_Yf_kcmx a,yp_ypbm b where a.ggid=b.ggid and deptid=" + Convert.ToInt32(cmbyjks.SelectedValue) + " ";
                }
                else
                {
                    ssql = "select a.ggid,cjid,0  rowno,yppm,ypgg,dbo.fun_yp_sccj(sccj) sccj,dbo.fun_yp_ypdw(ypdw) ypdw,1 dwbl,pfj,lsj,shh from vi_yp_ypcd a,yp_ypbm b where a.ggid=b.ggid   ";
                }
                TrasenFrame.Forms.Fshowcard f2 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.智能, control.Text.Trim(), ssql);
                f2.Location = point;
                f2.Width    = 700;
                f2.Height   = 300;
                f2.ShowDialog(this);
                row = f2.dataRow;
                if (row != null)
                {
                    this.txtdm.Text = row["yppm"].ToString();
                    this.txtdm.Tag  = row["cjid"].ToString();
                }
                break;

            case 5:
                if (control.Text.Trim() == "")
                {
                    return;
                }
                GrdMappingName = new string[] { "模板名称", "拼音码", "五笔码", "id" };
                GrdWidth       = new int[] { 150, 60, 60, 0 };
                sfield         = new string[] { "wbm", "pym", "", "", "" };
                ssql           = "select mbmc,pym,wbm,id from yp_yptjmb b where id>0   ";
                TrasenFrame.Forms.Fshowcard f3 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.智能, control.Text.Trim(), ssql);
                f3.Location = point;
                f3.Width    = 700;
                f3.Height   = 300;
                f3.ShowDialog(this);
                row = f3.dataRow;
                if (row != null)
                {
                    this.txtmb.Text = row["mbmc"].ToString();
                    this.txtmb.Tag  = row["id"].ToString();
                }
                break;

            case 4:
                if (control.Text.Trim() == "")
                {
                    return;
                }
                GrdMappingName = new string[] { "姓名", "拼音码", "五笔码", "id" };
                GrdWidth       = new int[] { 150, 60, 60, 0 };
                sfield         = new string[] { "wb_code", "py_code", "", "", "" };
                ssql           = "select name,py_code,wb_code,employee_id from jc_employee_property where employee_id>0   ";
                TrasenFrame.Forms.Fshowcard f4 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.拼音, control.Text.Trim(), ssql);
                f4.Location = point;
                f4.Width    = 700;
                f4.Height   = 300;
                f4.ShowDialog(this);
                row = f4.dataRow;
                if (row != null)
                {
                    this.txtfyr.Text = row["name"].ToString();
                    this.txtfyr.Tag  = row["employee_id"].ToString();
                }
                break;
            }
        }
Exemple #6
0
        private bool myDataGrid1_myKeyDown(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
        {
            try
            {
                DataTable tb         = (DataTable)this.myDataGrid1.DataSource;
                int       nrow       = this.myDataGrid1.CurrentCell.RowNumber;
                int       ncol       = this.myDataGrid1.CurrentCell.ColumnNumber;
                int       nkey       = Convert.ToInt32(keyData);
                string    columnName = this.myDataGrid1.TableStyles[0].GridColumnStyles[ncol].HeaderText.Trim();
                if (nrow > tb.Rows.Count - 1)
                {
                    return(true);
                }
                string coltext = "";
                DataGridTextBoxColumn txtCol = (DataGridTextBoxColumn)this.myDataGrid1.TableStyles[0].GridColumnStyles[ncol];
                coltext = txtCol.TextBox.Text;

                //如果名称列
                if (columnName.Trim() == "姓名" && nkey == 13)
                {
                    if (coltext.Trim() == "")
                    {
                        return(true);
                    }

                    if (nrow >= tb.Rows.Count - 1)
                    {
                        DataRow row = tb.NewRow();
                        row["序号"] = nrow + 2;
                        tb.Rows.Add(row);
                    }

                    tb.Rows[nrow]["姓名"]  = coltext;
                    tb.Rows[nrow]["拼音码"] = PubStaticFun.GetPYWBM(coltext, 0);
                    tb.Rows[nrow]["五笔码"] = PubStaticFun.GetPYWBM(coltext, 1);
                }


                //如果是供货单位列

                if (columnName.Trim() == "所属供货单位" && nkey == 32)
                {
                    string[] GrdMappingName;
                    int[]    GrdWidth;
                    string[] sfield;
                    string   ssql = "";
                    DataRow  row;

                    //Point point=new Point(this.Location.X+control.Location.X,this.Location.Y+control.Location.Y+control.Height*3 );
                    Point point = new Point(this.myDataGrid1.GetCellBounds(nrow, ncol).Left, this.myDataGrid1.GetCellBounds(nrow, ncol).Top + this.myDataGrid1.Top + this.myDataGrid1.GetCellBounds(nrow, ncol).Height);
                    GrdMappingName = new string[] { "id", "行号", "供货商", "拼音码", "五笔码" };
                    GrdWidth       = new int[] { 0, 50, 200, 100, 100 };
                    sfield         = new string[] { "wbm", "pym", "", "", "" };
                    ssql           = "select ID,0 rowno,ghdwmc,pym,wbm from yp_ghdw WHERE ID<>0 ";
                    TrasenFrame.Forms.Fshowcard f1 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.拼音, coltext.Trim(), ssql);
                    f1.Location = point;
                    f1.ShowDialog(this);
                    row = f1.dataRow;
                    if (row != null)
                    {
                        tb.Rows[nrow]["所属供货单位"]      = row["ghdwmc"].ToString().Trim();
                        tb.Rows[nrow]["ghdwid"]      = row["id"].ToString();
                        this.myDataGrid1.CurrentCell = new DataGridCell(nrow + 1, 1);
                        return(false);
                    }
                }

                if (nkey == 13 && columnName != "所属供货单位")
                {
                    this.myDataGrid1.CurrentCell = new DataGridCell(nrow, ncol + 1);
                }
                if (nkey == 13 && columnName == "所属供货单位")
                {
                    this.myDataGrid1.CurrentCell = new DataGridCell(nrow + 1, 1);
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("错误" + err.Message);
            }
            return(false);
        }
Exemple #7
0
        //输入框控制事件
        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
            {
                string[] GrdMappingName;
                int[]    GrdWidth;
                string[] sfield;
                string   ssql = "";
                DataRow  row;

                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;
                    }
                    GrdMappingName = new string[] { "id", "行号", "科室", "拼音码", "五笔码" };
                    GrdWidth       = new int[] { 0, 50, 200, 100, 100 };
                    sfield         = new string[] { "wb_code", "py_code", "", "", "" };
                    ssql           = "select ksbh dept_id,0 rowno,ksmc name,pym py_code,wbm wb_code from jc_yyksb where ksbh<>0 ";
                    TrasenFrame.Forms.Fshowcard f1 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, FilterType.拼音, control.Text.Trim(), ssql);
                    f1.Location = point;
                    f1.ShowDialog(this);
                    row = f1.dataRow;
                    if (row != null)
                    {
                        control.Text = row["name"].ToString();
                        control.Tag  = row["dept_id"].ToString();
                        this.SelectNextControl((Control)sender, true, false, true, true);
                    }
                    break;

                case 1:

                    if (control.Text.Trim() == "")
                    {
                        return;
                    }
                    GrdMappingName = new string[] { "ggid", "行号", "商品名", "品名", "规格", "单位" };
                    GrdWidth       = new int[] { 0, 50, 180, 180, 100, 40 };
                    sfield         = new string[] { "wbm", "pym", "szm", "ywm", "ypbm" };
                    ssql           = "select a.ggid,0 rowno,ypspm,yppm,ypgg,dbo.fun_yp_ypdw(ypdw) ypdw from yp_ypggd a,yp_ypbm b " +
                                     "where a.ggid=b.ggid  and bdelete=0  and yplx in(1,2)";

                    TrasenFrame.Forms.Fshowcard f2 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, Constant.CustomFilterType, control.Text.Trim(), ssql);
                    f2.Location = point;
                    f2.Width    = 700;
                    f2.Height   = 300;
                    f2.ShowDialog(this);
                    row = f2.dataRow;
                    if (row != null)
                    {
                        this.csyp(Convert.ToInt32(row["ggid"]), 0);
                        this.SelectNextControl((Control)sender, true, false, true, true);
                    }
                    break;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #8
0
        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
            {
                string[] GrdMappingName;
                int[]    GrdWidth;
                string[] sfield;
                string   ssql = "";
                DataRow  row;

                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;
                    }
                    GrdMappingName = new string[] { "ggid", "cjid", "行号", "品名", "规格", "单位", "货号" };
                    GrdWidth       = new int[] { 0, 0, 30, 150, 100, 40, 60 };
                    sfield         = new string[] { "wbm", "pym", "szm", "ywm", "ypbm" };
                    ssql           = "select a.ggid,cjid,0 rowno,s_ypspm,s_ypgg,s_ypdw,shh from yp_ypcjd a,yp_ypbm b " +
                                     " where a.ggid=b.ggid and a.bdelete=0 and n_ypzlx in(2,4,6) ";                   //and a.n_ypzlx in(select ypzlx from yp_gllx where deptid="+InstanceForm.BCurrentDept.DeptId+")  ";
                    TrasenFrame.Forms.Fshowcard f2 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, Constant.CustomFilterType, control.Text.Trim(), ssql);
                    f2.Location = point;
                    f2.Width    = 700;
                    f2.Height   = 300;
                    f2.Text     = "选择自制药品";
                    f2.ShowDialog(this);
                    row = f2.dataRow;
                    if (row != null)
                    {
                        this.txtzzypmc.Text = row["s_ypspm"].ToString();
                        this.txtzzypmc.Tag  = row["cjid"].ToString().Trim();
                        this.SelectNextControl((Control)sender, true, false, true, true);
                    }
                    break;

                case 2:
                    if (control.Text.Trim() == "")
                    {
                        return;
                    }
                    GrdMappingName = new string[] { "ggid", "cjid", "行号", "品名", "规格", "单位", "货号" };
                    GrdWidth       = new int[] { 0, 0, 30, 150, 100, 40, 60 };
                    sfield         = new string[] { "wbm", "pym", "szm", "ywm", "ypbm" };
                    ssql           = "select a.ggid,cjid,0 rowno,s_ypspm,s_ypgg,s_ypdw,shh from yp_ypcjd a,yp_ypbm b " +
                                     " where a.ggid=b.ggid and a.bdelete=0 and a.n_ypzlx in(select ypzlx from yp_gllx where deptid=" + InstanceForm.BCurrentDept.DeptId + ")  ";
                    TrasenFrame.Forms.Fshowcard f3 = new TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, Constant.CustomFilterType, control.Text.Trim(), ssql);
                    f3.Location = point;
                    f3.Width    = 700;
                    f3.Height   = 300;
                    f3.Text     = "选择原料";
                    f3.ShowDialog(this);
                    row = f3.dataRow;
                    if (row != null)
                    {
                        this.txtylmc.Text = row["s_ypspm"].ToString();
                        this.txtylmc.Tag  = row["cjid"].ToString().Trim();
                        DataTable tb = Yp.SelectYpcl(InstanceForm.BCurrentDept.DeptId, Convert.ToInt32(row["cjid"]), InstanceForm.BDatabase);
                        if (tb.Rows.Count == 0)
                        {
                            lbldw.Text = row["S_YPDW"].ToString().Trim();
                            lbldw.Tag  = "1";
                        }
                        else
                        {
                            lbldw.Text = Yp.SeekYpdw(Convert.ToInt32(tb.Rows[0]["zxdw"]), InstanceForm.BDatabase);
                            lbldw.Tag  = tb.Rows[0]["dwbl"].ToString();
                        }

                        this.SelectNextControl((Control)sender, true, false, true, true);
                    }
                    break;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }
Exemple #9
0
        private void TextKeyUp(object sender, KeyEventArgs e)        //KeyEventArgs
        {
            if (this.rdojy.Checked == false)
            {
                return;
            }
            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
            {
                string[] GrdMappingName;
                int[]    GrdWidth;
                string[] sfield;
                string   ssql = "";
                DataRow  row;

                Point point = new Point(this.Location.X + control.Location.X, this.Location.Y + control.Location.Y + control.Height * 3);
                switch (control.TabIndex)
                {
                case 35:
                    if (control.Text.Trim() == "")
                    {
                        return;
                    }
                    GrdMappingName = new string[] { "ggid", "cjid", "行号", "品名", "规格", "厂家", "单位", "DWBL", "批发价", "零售价", "货号" };
                    GrdWidth       = new int[] { 0, 0, 30, 140, 90, 90, 30, 0, 60, 60, 70 };
                    sfield         = new string[] { "wbm", "pym", "szm", "ywm", "ypbm" };
                    ssql           = "select distinct a.ggid,cjid,0  rowno,s_ypspm,s_ypgg,s_sccj sccj,s_ypdw ypdw,1 dwbl,pfj,lsj,shh from yp_ypcjd a,yp_ypbm b where a.ggid=b.ggid   and a.cjid in (select cjid from vi_yk_kcmx  where deptid=" + InstanceForm.BCurrentDept.DeptId + " or deptid in(select deptid from yp_yjks_gx where p_deptid=" + InstanceForm.BCurrentDept.DeptId + ") )";
                    TrasenFrame.Forms.Fshowcard f2 = new  TrasenFrame.Forms.Fshowcard(GrdMappingName, GrdWidth, sfield, Constant.CustomFilterType, control.Text.Trim(), ssql);
                    f2.Location = point;
                    f2.Width    = 700;
                    f2.Height   = 300;
                    f2.ShowDialog(this);
                    row = f2.dataRow;
                    if (row != null)
                    {
                        this.SelectNextControl((Control)sender, true, false, true, true);
                        control.Text = row["s_ypspm"].ToString();
                        control.Tag  = row["cjid"].ToString();
                    }
                    break;
                }
            }
            catch (System.Exception err)
            {
                MessageBox.Show("发生错误" + err.Message);
            }
        }