Example #1
0
 private void Goiss()
 {
     if (textBox15.Text.Trim() != "")
     {
         string sql = "SELECT xuhao as '工序号',gongxumingcheng as '工序名称',jihuariqi as '计划完成日期'," +
                      "shengchanyuan as '生产班组',wanshengsuliang as'完成数量',jgsu as '加工数',xujah as'序价号'," +
                      "xujia as '序价',buzu as '补助',gongsi as '公式',hezhi as '件资合计',lururiqi as '录入日期'," +
                      "luruyan as '录入人',qiugairiqi as '修改日期',qgren as '修改人' FROM tf_sgdantwo " +
                      $"WHERE shigongdanhao='{textBox15.Text.Trim()}'";
         DataSet ds = SqlHelper.ExecuteDataset(SqlHelper.GetConnection(), CommandType.Text, sql);
         dataGridView1.DataSource        = ds.Tables[0];
         dataGridView1.Columns[0].Width  = 60;
         dataGridView1.Columns[1].Width  = 75;
         dataGridView1.Columns[2].Width  = 90;
         dataGridView1.Columns[3].Width  = 70;
         dataGridView1.Columns[4].Width  = 60;
         dataGridView1.Columns[5].Width  = 60;
         dataGridView1.Columns[6].Width  = 60;
         dataGridView1.Columns[7].Width  = 60;
         dataGridView1.Columns[8].Width  = 50;
         dataGridView1.Columns[9].Width  = 50;
         dataGridView1.Columns[10].Width = 100;
         dataGridView1.Columns[11].Width = 100;
         dataGridView1.Columns[12].Width = 60;
         dataGridView1.Columns[13].Width = 100;
         dataGridView1.Columns[14].Width = 60;
         dataGridView1.Sort(dataGridView1.Columns[0], System.ComponentModel.ListSortDirection.Ascending);
     }
 }
Example #2
0
        /// <summary>
        ///     DataGridView的绑定数据
        /// </summary>
        private void BindData()
        {
            _wono = txtWONo.Text.Trim();
            if (_wono == "")
            {
                return;
            }
            var sql = "SELECT xuhao '工序号',gongxumingcheng '工序名称',jihuariqi '计划完成日期'," +
                      "shengchanyuan '生产班组',wanshengsuliang '完成数量',jgsu '加工数',xujah '序价号',xujia '序价'," +
                      "buzu '补助',hezhi '件资合计',lururiqi '录入日期',luruyan '录入人',qiugairiqi '修改日期'," +
                      $"qgren '修改人' FROM tf_sgdantwo WHERE shigongdanhao='{txtWONo.Text.Trim()}'";
            var ds = SqlHelper.ExecuteDataset(SqlHelper.GetConnection(), CommandType.Text, sql);

            dataGridView1.DataSource = ds.Tables[0];
            dataGridView1.Sort(dataGridView1.Columns[0], ListSortDirection.Ascending);
            if (IsChecked(_wono))
            {
                lblCheck.Visible = true;
            }
        }
        private void BindData()
        {
            var sql = $"SELECT Craft FROM PD_ProcCard_UPrice WHERE DeptId='{SqlHelper.DeptId}' ORDER BY ID";
            var ds  = SqlHelper.ExecuteDataset(SqlHelper.GetConnectionString("dzdj"), CommandType.Text, sql);

            cbxCraft.DataSource    = ds.Tables[0];
            cbxCraft.DisplayMember = "Craft";
            cbxCraft.ValueMember   = "Craft";
            sql = "SELECT IDO '流水',iname '工序名称',qtime '时间起',ztime '时间止'," +
                  "jilu '单价基数',jisu '计算折率',beizu '备注' FROM udodt  ORDER BY iname , ztime ";
            ds = SqlHelper.ExecuteDataset(SqlHelper.GetConnection(), CommandType.Text, sql);
            dataGridView1.DataSource       = ds.Tables[0];
            dataGridView1.Columns[0].Width = 60;
            dataGridView1.Columns[1].Width = 80;
            dataGridView1.Columns[2].Width = 80;
            dataGridView1.Columns[3].Width = 80;
            dataGridView1.Columns[4].Width = 80;
            dataGridView1.Columns[5].Width = 80;
            dataGridView1.Columns[6].Width = 200;
            dataGridView1.Sort(dataGridView1.Columns[0], System.ComponentModel.ListSortDirection.Ascending);
        }
Example #4
0
        private void BindData()
        {
            panel1.Visible = false;
            panel2.Visible = false;
            panel3.Visible = true;

            const string sql = "SELECT xujhao '序价号',xujia '序价',buzu '补助',gongsi '公式'," +
                               "shiyong '适用班组',beizu '序价说明',cjren '创建',cjriqi '创建日期',qgren '修改',qgriqi '修改日期' FROM xujia ";
            var ds = SqlHelper.ExecuteDataset(SqlHelper.GetConnection(), CommandType.Text, sql);

            dataGridView1.DataSource       = ds.Tables[0];
            dataGridView1.Columns[0].Width = 80;
            dataGridView1.Columns[1].Width = 80;
            dataGridView1.Columns[2].Width = 80;
            dataGridView1.Columns[3].Width = 55;
            dataGridView1.Columns[4].Width = 80;
            dataGridView1.Columns[5].Width = 222;
            dataGridView1.Columns[6].Width = 55;
            dataGridView1.Columns[7].Width = 80;
            dataGridView1.Columns[8].Width = 55;
            dataGridView1.Columns[9].Width = 80;
            dataGridView1.Sort(dataGridView1.Columns[0], System.ComponentModel.ListSortDirection.Ascending);
        }