Example #1
0
 public static TempEmpQuery GetInstance()
 {
     if (weqform == null || weqform.IsDisposed)
     {
         weqform = new TempEmpQuery();
     }
     return(weqform);
 }
Example #2
0
        private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e)
        {
            TempEmpQuery Frm = TempEmpQuery.GetInstance();

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
        }
Example #3
0
        private void LineType_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            TempEmpQuery Frm = TempEmpQuery.GetInstance();

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
            Frm.Height = this.Height - 20;
        }
Example #4
0
        private void barButtonItem删除_ItemClick(object sender, ItemClickEventArgs e)
        {
            bool right = TempEmpUpdate.ModifyRight();

            if (right)
            {
                TempEmpQuery.Delete();
                TempEmpQuery.RefreshEX();
            }
            else
            {
                MessageBox.Show("没有权限!");
            }
        }
Example #5
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string cno = "", cname = "", sex = "", register_date = "", leave_date = "", cfrom = "", dept1 = "", dept2 = "", dept3 = "", dept = "", id_number = "", phone_no = "", shift = "", status = "";
            int    fromtype = 1;

            TempEmpQuery.GetInfo(ref cno, ref cname, ref sex, ref register_date, ref leave_date, ref cfrom, ref fromtype, ref dept1, ref dept2, ref dept3, ref dept, ref id_number, ref phone_no, ref shift, ref status);
            if (cno != "")
            {
                TempEmpUpdate Frm = new TempEmpUpdate();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }
Example #6
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string leave_date, sql;

            if ((comboBoxStatus.Text.ToString() == "离职" || comboBoxStatus.Text.ToString() == "转正") && textEditLeaveDate.Text.ToString() == "")
            {
                MessageBox.Show("请先填写离职日期!");
            }
            else if (comboBoxStatus.Text.ToString() == "在职" && textEditLeaveDate.Text.ToString() != "")
            {
                MessageBox.Show("请去掉离职日期!");
            }
            else
            {
                if (textEditLeaveDate.Text.ToString() == "")
                {
                    sql = "update COST_TEMP_EMPLOYEE set cname = '" + textEditName.Text.ToString().Trim() + "',sex = '" + comboBoxSex.Text + "',register_date='" + dateTimePickerRegister.Text + "',leave_date=NULL,cfrom = '" + textEditFrom.Text.ToString().Trim() + "',from_type = '" + comboBoxType.SelectedValue.ToString() + "',dept1 = '" + comboBoxDept1.Text + "',dept2 = '" + comboBoxDept2.Text + "',dept3 = '" + comboBoxDept3.Text + "',dept = '" + comboBoxDept.Text + "',id_number = '" + textEditIdNumber.Text.ToString().Trim() + "',phone_no = '" + textEditPhone.Text.ToString().Trim() + "',shift = '" + comboBoxShift.Text + "',status = '" + comboBoxStatus.SelectedItem + "'";
                    sql = sql + " where cno = '" + textEditCno.Text.ToString() + "'";
                }
                else
                {
                    leave_date = textEditLeaveDate.Text.ToString();
                    sql        = "update COST_TEMP_EMPLOYEE set cname = '" + textEditName.Text.ToString().Trim() + "',sex = '" + comboBoxSex.Text + "',register_date='" + dateTimePickerRegister.Text + "',leave_date='" + leave_date + "',cfrom = '" + textEditFrom.Text.ToString().Trim() + "',from_type = '" + comboBoxType.SelectedValue.ToString() + "',dept1 = '" + comboBoxDept1.Text + "',dept2 = '" + comboBoxDept2.Text + "',dept3 = '" + comboBoxDept3.Text + "',dept = '" + comboBoxDept.Text + "',id_number = '" + textEditIdNumber.Text.ToString().Trim() + "',phone_no = '" + textEditPhone.Text.ToString().Trim() + "',shift = '" + comboBoxShift.Text + "',status = '" + comboBoxStatus.SelectedItem + "'";
                    sql        = sql + " where cno = '" + textEditCno.Text.ToString() + "'";
                }

                bool isok = conn.EditDatabase(sql);
                if (isok)
                {
                    MessageBox.Show("修改成功!");
                    TempEmpQuery.RefreshEX();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("失败!");
                }
            }

            conn.Close();
        }
Example #7
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string strsql, strsql2;
            int    rows;
            string cno = GenerateNo();

            strsql  = "insert into COST_TEMP_EMPLOYEE(cno,cname,sex,register_date,cfrom,from_type,dept1,dept2,dept3,dept,id_number,phone_no,shift,status) values('" + cno + "','" + textEditName.Text.ToString().Trim() + "','" + comboBoxSex.Text.ToString() + "','" + dateTimePicker1.Text.ToString() + "','" + textEditFrom.Text.ToString().Trim() + "','" + comboBoxType.SelectedValue + "','" + comboBoxDept1.SelectedValue + "','" + comboBoxDept2.SelectedValue + "','" + comboBoxDept3.SelectedValue + "','" + comboBoxDept.SelectedValue + "','" + textEditIDNumber.Text.ToString().Trim() + "','" + textEditPhone.Text.ToString().Trim() + "','" + comboBoxShift.SelectedValue.ToString() + "','在职')";
            strsql2 = "select cno from COST_TEMP_EMPLOYEE where cno ='" + cno + "'";
            if (textEditIDNumber.Text.ToString().Trim() != "" && textEditName.Text.ToString().Trim() != "")
            {
                rows = conn.ReturnRecordCount(strsql2);
                if (rows > 0)
                {
                    MessageBox.Show("该工号已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(strsql);
                    if (isok)
                    {
                        MessageBox.Show("添加成功!");
                        TempEmpQuery.RefreshEX();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("姓名和身份证号不能为空!");
            }
            conn.Close();
        }
Example #8
0
 private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e)
 {
     TempEmpQuery.RefreshEX();
 }
Example #9
0
        private void TempWorkerPriceUpdate_Load(object sender, EventArgs e)
        {
            BindDept1();
            BindDept2();
            BindShift();
            BindType();
            string cno = "", cname = "", sex = "", register_date = "", leave_date = "", cfrom = "", dept1 = "", dept2 = "", dept3 = "", dept = "", id_number = "", phone_no = "", shift = "", status = "";
            int    fromtype = 1;
            bool   right;

            TempEmpQuery.GetInfo(ref cno, ref cname, ref sex, ref register_date, ref leave_date, ref cfrom, ref fromtype, ref dept1, ref dept2, ref dept3, ref dept, ref id_number, ref phone_no, ref shift, ref status);
            if (cno != "")
            {
                right             = ModifyRight();
                textEditCno.Text  = cno;
                textEditName.Text = cname;
                //comboBoxSex.SelectedIndex = -1;
                //comboBoxSex.SelectedValue = sex;
                comboBoxSex.SelectedItem    = sex;
                dateTimePickerRegister.Text = register_date;
                textEditLeaveDate.Text      = leave_date;
                i = true;
                dateTimePickerLeave.Text = "";
                textEditFrom.Text        = cfrom;
                //comboBoxDept1.SelectedIndex = -1;
                //comboBoxDept1.SelectedValue = dept1;
                //comboBoxDept2.SelectedIndex = -1;
                //comboBoxDept2.SelectedValue = dept2;
                comboBoxDept1.Text          = dept1;
                comboBoxDept2.Text          = dept2;
                comboBoxDept3.Text          = dept3;
                comboBoxDept.Text           = dept;
                textEditIdNumber.Text       = id_number;
                textEditPhone.Text          = phone_no;
                comboBoxShift.SelectedIndex = -1;
                comboBoxShift.SelectedValue = shift;
                comboBoxType.SelectedIndex  = -1;
                if (fromtype == 0)
                {
                    comboBoxType.SelectedValue = DBNull.Value;
                }
                else
                {
                    comboBoxType.SelectedValue = fromtype;
                }
                comboBoxStatus.SelectedItem = status;
                if (!right)
                {
                    textEditName.Enabled           = false;
                    comboBoxSex.Enabled            = false;
                    dateTimePickerRegister.Enabled = false;
                    textEditLeaveDate.Enabled      = false;
                    dateTimePickerLeave.Enabled    = false;
                    textEditFrom.Enabled           = false;
                    comboBoxType.Enabled           = false;
                    textEditIdNumber.Enabled       = false;
                    textEditPhone.Enabled          = false;
                    comboBoxStatus.Enabled         = false;
                }
            }

            //dateTimePicker1.Focus();
            //SendKeys.Send("{RIGHT} ");
        }