Ejemplo n.º 1
0
        private void IndirectLabourUpdate_Load(object sender, EventArgs e)
        {
            string cno = "", cname = "", positionname = "", deptname = "";
            int    id = 0, positionid = 0, deptid = 0, person_level = 0;

            IndirectLabourQuery.GetInfo(ref id, ref cno, ref cname, ref positionid, ref positionname, ref person_level, ref deptid, ref deptname);
            PositionBind();
            Common.BasicDataBind("cost_dept", comboBoxDept);
            ConnDB conn  = new ConnDB();
            string sql   = "select * from cost_dept where cid = " + deptid + " and isnull(forbidden,'false') = 'true'";
            int    rows  = conn.ReturnRecordCount(sql);
            string sql2  = "select * from cost_position where cid = " + positionid + " and isnull(forbidden,'false') = 'true'";
            int    rows2 = conn.ReturnRecordCount(sql);

            if (cno != "")
            {
                textEditNo.Text    = cno;
                textEditName.Text  = cname;
                textEditLevel.Text = person_level.ToString();
                if (rows == 0)
                {
                    comboBoxDept.SelectedIndex = -1;
                    comboBoxDept.SelectedValue = deptid;
                }
                if (rows2 == 0)
                {
                    comboBoxPosition.SelectedIndex = -1;
                    comboBoxPosition.SelectedValue = positionid;
                }
                textEditID.Text = id.ToString();
            }
        }
Ejemplo n.º 2
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string cno = "", cname = "", positionname = "", deptname = "";
            int    id = 0, positionid = 0, deptid = 0, person_level = 0;

            IndirectLabourQuery.GetInfo(ref id, ref cno, ref cname, ref positionid, ref positionname, ref person_level, ref deptid, ref deptname);
            if (cno != "")
            {
                IndirectLabourUpdate Frm = new IndirectLabourUpdate();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }