예제 #1
0
        public static void Save()
        {
            ConnDB conn = new ConnDB();
            string sql;
            bool   isok   = false;
            string yyyymm = DirectLabourPriceQuery.GetMonth();

            if (yyyymm != "")
            {
                dlpuform.gridView1.FocusInvalidRow();
                for (int i = 0; i < dlpuform.gridView1.RowCount; i++)
                {
                    sql  = "update cost_direct_labour_price set price = " + dlpuform.gridView1.GetDataRow(i).ItemArray[3].ToString() + " where yyyymm = '" + yyyymm + "' and work_type = " + dlpuform.gridView1.GetDataRow(i).ItemArray[1].ToString();
                    isok = conn.EditDatabase(sql);
                }
            }
            if (isok)
            {
                MessageBox.Show("修改成功!");
                DirectLabourPriceQuery.RefreshEX();
                dlpuform.Close();
            }
            else
            {
                MessageBox.Show("失败!");
            }
            dlpuform.ischange = false;
            conn.Close();
            dlpuform.Close();
            DirectLabourPrice.savetype = "insert";
        }
예제 #2
0
        private void barButtonItem修改_ItemClick(object sender, ItemClickEventArgs e)
        {
            string month = DirectLabourPriceQuery.GetMonth();

            if (month != "")
            {
                DirectLabourPriceUpdate Frm = DirectLabourPriceUpdate.GetInstance();
                Frm.TopLevel = false;
                Frm.Parent   = this;
                Frm.Show();
                Frm.BringToFront();
            }
        }
예제 #3
0
        private void ShowDetail()
        {
            string yyyymm = DirectLabourPriceQuery.GetMonth();
            string strsql;

            if (yyyymm != "")
            {
                ConnDB conn = new ConnDB();
                strsql = "select i.yyyymm 年月,j.CID,j.CNAME 上班类型,i.price '费率(元/小时)' from (select * from cost_direct_labour_price where isnull(YYYYMM,'') ='" + yyyymm + "') i left join (select * from COST_WORK_TYPE where forbidden = 'false') j on i.WORK_TYPE = j.cid  ";
                DataSet ds = conn.ReturnDataSet(strsql);
                gridControl1.DataSource      = ds.Tables[0].DefaultView;
                gridView1.Columns[1].Visible = false;

                gridView1.Columns[0].OptionsColumn.ReadOnly = true;
                gridView1.Columns[1].OptionsColumn.ReadOnly = true;
                gridView1.Columns[2].OptionsColumn.ReadOnly = true;
                conn.Close();
            }
        }