Exemple #1
0
        public void LoadData()
        {
            string    sql = "SELECT Wodate,shift,keycode,modelcode,goodqty,defqty,mixqty,total,starttime,endtime,linename,empname FROM tb_datachecked where wodate='" + GetWorkDateTime() + "' and shift='" + txtShift.Text + "' order by starttime desc";
            DataTable dt  = conn.GetDataTable(sql);

            dgvData.DataSource = dt;
        }
Exemple #2
0
        //DataTable datagood,datang;
        public void LoadData()
        {
            frm_Loading loading = new frm_Loading();

            loading.ShowDialog();
            string    sql = "SELECT Wodate,shift,keycode,modelcode,goodqty,defqty,mixqty,total,starttime,endtime,linename,empname FROM tb_datachecked where wodate between '" + fromdate + "' and '" + todate + "' and shift like '%" + GetShift() + "%' and modelcode like '%" + txtCheck.Text.Trim().ToUpper() + "%' order by wodate desc,starttime desc";
            DataTable dt  = conn.GetDataTable(sql);

            dgvData.DataSource = dt;
        }
Exemple #3
0
        private void frm_EditDeff_Load(object sender, EventArgs e)
        {
            string servername_ = tool.Read(pathfile, "DataBase", "Server");
            string database_   = tool.Read(pathfile, "DataBase", "DataBase");
            string user_       = tool.Read(pathfile, "DataBase", "User");

            conn = new ConnectSQL(servername_, database_, user_);
            frm  = this;
            if (keycode != "")
            {
                string    sql = "select Wodate,shift,keycode,modelcode,goodqty,defqty,mixqty,total,starttime,endtime,linename,empname from tb_datachecked where keycode='" + keycode + "'";
                DataTable dt  = conn.GetDataTable(sql);
                if (dt.Rows.Count == 1)
                {
                    try
                    {
                        txtdef.Text = dt.Rows[0]["defqty"].ToString();

                        int.TryParse(txtdef.Text, out deftmp);

                        txtempname.Text   = dt.Rows[0]["empname"].ToString();
                        txtendtime.Text   = dt.Rows[0]["endtime"].ToString();
                        txtgood.Text      = dt.Rows[0]["goodqty"].ToString();
                        txtkeycode.Text   = dt.Rows[0]["keycode"].ToString();
                        txtlinename.Text  = dt.Rows[0]["linename"].ToString();
                        txtmix.Text       = dt.Rows[0]["mixqty"].ToString();
                        txtmodelcode.Text = dt.Rows[0]["modelcode"].ToString();
                        txtshift.Text     = dt.Rows[0]["shift"].ToString();
                        txtstarttime.Text = dt.Rows[0]["starttime"].ToString();
                        txttotal.Text     = dt.Rows[0]["total"].ToString();
                        int.TryParse(txttotal.Text, out totaltmp);
                        txtwodate.Text = dt.Rows[0]["wodate"].ToString();
                    }
                    catch
                    {
                        frm_MessageWarning warning = new frm_MessageWarning();
                        warning.index = 6;
                        warning.ShowDialog();
                    }
                }
            }
            GetAllControls(this);
            foreach (Control c in ControlList)
            {
                tool.TranslateControl(this, c, tool.GetLanguage(tool.Read(pathfile, "Infor", "Language")));
            }
        }