示例#1
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string sql  = "update COST_TEMP_EMPLOYEE_price set supplier = '" + textEditSupplier.Text.ToString().Trim() + "',begin_date = '" + dateTimePickerBegin.Text + "',end_date='" + dateTimePickerEnd.Text + "',from_type='" + comboBoxType.SelectedValue.ToString() + "',price='" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "',meal_price='" + Common.IsNull(textEditMeal.Text.ToString().Trim()) + "',night_price='" + Common.IsNull(textEditNight.Text.ToString().Trim()) + "',travel_price='" + Common.IsNull(textEditTravel.Text.ToString().Trim()) + "',regular_price='" + Common.IsNull(textEditRegular.Text.ToString().Trim()) + "'";

            sql = sql + " where cid =  '" + id + "'";
            string sql2 = "select * from cost_temp_employee_price where cid <> '" + id + "' and supplier = '" + textEditSupplier.Text.ToString().Trim() + "' and not (begin_date > '" + dateTimePickerEnd.Text.ToString() + "' or end_date <'" + dateTimePickerBegin.Text.ToString() + "') and from_type = '" + comboBoxType.SelectedValue.ToString() + "' and type =1";
            int    rows = conn.ReturnRecordCount(sql2);

            if (rows > 0)
            {
                MessageBox.Show("此时间范围的价格信息已经存在!");
            }
            else
            {
                bool isok = conn.EditDatabase(sql);
                if (isok)
                {
                    MessageBox.Show("修改成功!");
                    TempEmpPriceQuery.RefreshEX();
                    this.Close();
                }
                else
                {
                    MessageBox.Show("失败!");
                }
            }
            conn.Close();
        }
示例#2
0
 public static TempEmpPriceQuery GetInstance()
 {
     if (weqform == null || weqform.IsDisposed)
     {
         weqform = new TempEmpPriceQuery();
     }
     return(weqform);
 }
示例#3
0
        private void barButtonItem查询_ItemClick(object sender, ItemClickEventArgs e)
        {
            TempEmpPriceQuery Frm = TempEmpPriceQuery.GetInstance();

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

            Frm.TopLevel = false;
            Frm.Parent   = this;
            Frm.Show();
            Frm.BringToFront();
        }
示例#5
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string id = "", supplier = "", begin_date = "", end_date = "", from_type = "0", price = "", meal_price = "", night_price = "", travel_price = "", regular_price = "";

            TempEmpPriceQuery.GetInfo(ref id, ref supplier, ref begin_date, ref end_date, ref from_type, ref price, ref meal_price, ref night_price, ref travel_price, ref regular_price);
            if (supplier != "")
            {
                TempEmpPriceUpdate Frm = new TempEmpPriceUpdate();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }
示例#6
0
 private void TempWorkerPriceUpdate_Load(object sender, EventArgs e)
 {
     BindType();
     TempEmpPriceQuery.GetInfo(ref id, ref supplier, ref begin_date, ref end_date, ref from_type, ref price, ref meal_price, ref night_price, ref travel_price, ref regular_price);
     if (supplier != "")
     {
         textEditSupplier.Text      = supplier;
         dateTimePickerBegin.Text   = begin_date;
         dateTimePickerEnd.Text     = end_date;
         textEditPrice.Text         = price;
         textEditMeal.Text          = meal_price;
         textEditNight.Text         = night_price;
         textEditTravel.Text        = travel_price;
         textEditRegular.Text       = regular_price;
         comboBoxType.SelectedIndex = -1;
         comboBoxType.SelectedValue = from_type;
     }
 }
示例#7
0
        private void simpleButtonOK_Click(object sender, EventArgs e)
        {
            ConnDB conn = new ConnDB();
            string strsql, strsql2;
            int    rows;

            strsql  = "insert into COST_TEMP_EMPLOYEE_PRICE(TYPE,SUPPLIER,BEGIN_DATE,END_DATE,FROM_TYPE,PRICE,MEAL_PRICE,NIGHT_PRICE,TRAVEL_PRICE,REGULAR_PRICE) values(1,'" + textEditSupplier.Text.ToString().Trim() + "','" + dateTimePickerBegin.Text.ToString() + "','" + dateTimePickerEnd.Text.ToString() + "','" + comboBoxType.SelectedValue.ToString() + "','" + Common.IsNull(textEditPrice.Text.ToString().Trim()) + "','" + Common.IsNull(textEditMeal.Text.ToString().Trim()) + "','" + Common.IsNull(textEditNight.Text.ToString().Trim()) + "','" + Common.IsNull(textEditTravel.Text.ToString().Trim()) + "','" + Common.IsNull(textEditRegular.Text.ToString().Trim()) + "')";
            strsql2 = "select price from COST_TEMP_EMPLOYEE_PRICE where SUPPLIER ='" + textEditSupplier.Text.ToString().Trim() + "' and not (begin_date > '" + dateTimePickerEnd.Text.ToString() + "' or end_date <'" + dateTimePickerBegin.Text.ToString() + "') and from_type = '" + comboBoxType.SelectedValue.ToString() + "' and type = 1";
            if (textEditSupplier.Text.ToString().Trim() != "")
            {
                rows = conn.ReturnRecordCount(strsql2);
                if (rows > 0)
                {
                    MessageBox.Show("此时间范围的价格信息已经存在!");
                }
                else
                {
                    bool isok = conn.EditDatabase(strsql);
                    if (isok)
                    {
                        MessageBox.Show("添加成功!");
                        TempEmpPriceQuery.RefreshEX();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("失败!");
                    }
                }
            }
            else
            {
                MessageBox.Show("供应商不能为空!");
            }
            conn.Close();
        }
示例#8
0
 private void barButtonItem刷新_ItemClick(object sender, ItemClickEventArgs e)
 {
     TempEmpPriceQuery.RefreshEX();
 }