private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string sql  = "update COST_EXPENSE set emp_no = '" + textEditEmpno.Text.ToString().Trim() + "',begin_date = '" + dateTimePickerDate.Text + "',expense='" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "'";

            sql = sql + " where cid =  '" + id + "'";
            string sql2 = "select * from COST_EXPENSE where cid <> '" + id + "' and emp_no = '" + textEditEmpno.Text.ToString().Trim() + "' and begin_date = '" + dateTimePickerDate.Text.ToString() + "'  and ctype =2";
            int    rows = conn.ReturnRecordCount(sql2);

            if (rows > 0)
            {
                MessageBox.Show("该员工这天的交通补贴信息已经存在!");
            }
            else
            {
                bool isok = conn.EditDatabase(sql);
                if (isok)
                {
                    MessageBox.Show("修改成功!");
                    TempEmpTravelExpenseQuery.RefreshEX();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("失败!");
                }
            }
            conn.Close();
        }
 public static TempEmpTravelExpenseQuery GetInstance()
 {
     if (weqform == null || weqform.IsDisposed)
     {
         weqform = new TempEmpTravelExpenseQuery();
     }
     return(weqform);
 }
Example #3
0
        private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e)
        {
            TempEmpTravelExpenseQuery Frm = TempEmpTravelExpenseQuery.GetInstance();

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

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
        }
 private void TempWorkerPriceUpdate_Load(object sender, EventArgs e)
 {
     TempEmpTravelExpenseQuery.GetInfo(ref id, ref empno, ref name, ref begin_date, ref expense);
     if (id != "")
     {
         textEditEmpno.Text      = empno;
         textEditName.Text       = name;
         dateTimePickerDate.Text = begin_date;
         textEditPrice.Text      = expense;
     }
 }
Example #6
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string id = "", empno = "", name = "", begin_date = "", expense = "0";

            TempEmpTravelExpenseQuery.GetInfo(ref id, ref empno, ref name, ref begin_date, ref expense);
            if (id != "")
            {
                TempEmpTravelExpenseUpdate Frm = new TempEmpTravelExpenseUpdate();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string strsql, strsql2;
            int    rows;

            strsql  = "insert into COST_EXPENSE(CTYPE,TYPE_DES,BEGIN_DATE,EMP_NO,EXPENSE) values(2,'交通补贴','" + dateTimePickerBegin.Text.ToString() + "','" + textEditEmpno.Text.ToString().Trim() + "','" + textEditPrice.Text.ToString().Trim() + "')";
            strsql2 = "select EXPENSE from  COST_EXPENSE where ctype =2 and emp_no ='" + textEditEmpno.Text.ToString().Trim() + "' and begin_date = '" + dateTimePickerBegin.Text.ToString() + "'";
            if (textEditEmpno.Text.ToString().Trim() != "")
            {
                rows = conn.ReturnRecordCount(strsql2);
                if (rows > 0)
                {
                    MessageBox.Show("该员工此日期的交通补贴已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(strsql);
                    if (isok)
                    {
                        MessageBox.Show("添加成功!");
                        TempEmpTravelExpenseQuery.RefreshEX();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("工号不能为空!");
            }
            conn.Close();
        }
Example #8
0
 private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e)
 {
     TempEmpTravelExpenseQuery.RefreshEX();
 }