Beispiel #1
0
        void showDetail()
        {   //庫存驗貨單
            string    sqlstr  = "select * from Reserve_Import where form_no = " + Form_No.Text;
            DataTable myTable = mydb.GetDataTable(sqlstr);

            Emp_Id.Text         = myTable.Rows[0]["Emp_Id"].ToString();
            Status_Id.Text      = myTable.Rows[0]["Status_Id"].ToString();
            sqlstr              = "select comment from status ";
            sqlstr             += " where class='Reserve' ";
            sqlstr             += "  and  Status_Id = " + mydb.qo(Status_Id.Text);
            Status_Comment.Text = mydb.getSingleData(0, sqlstr);
            Import_Date.Text    = myTable.Rows[0]["import_date"].ToString();
            Vendor_Id.Text      = myTable.Rows[0]["Vendor_Id"].ToString().Trim();
            sqlstr              = " select vendor_name from vendor where Vendor_Id=" + mydb.qo(Vendor_Id.Text);
            Vendor_Name.Text    = mydb.getSingleData(0, sqlstr);
            Comment.Text        = myTable.Rows[0]["Comment"].ToString().Trim();
            //進貨明細
            sqlstr             = "select  d.Form_No as Form_No, d.mat_id as mat_id, m.mat_name as mat_name, d.qty as qty, d.price as price, d.comment as comment ";
            sqlstr            += " from Material_Import_Detail d, Material M ";
            sqlstr            += " where d.form_no = " + Form_No.Text;
            sqlstr            += "   and d.mat_id = m.mat_id ";
            ResGrid.DataSource = mydb.GetDataTable(sqlstr);
            ResGrid.DataBind();
            //驗貨
            sqlstr  = "select  * from Verify ";
            sqlstr += " where form_no = " + Form_No.Text;
            //sqlstr += " and class='IMPORT'";
            ProcessGrid.DataSource = mydb.GetDataTable(sqlstr);
            ProcessGrid.DataBind();
        }
Beispiel #2
0
        void showDetail()
        {   //Material_Import
            string sqlstr = "Select M.Form_No , mat.mat_name ,M.Emp_Id ,M.Form_Date, M.Import_Date, M.Vendor_Id, p.Pay_Name";

            sqlstr += " from Material_Import M , Material mat , Pay p, Status s";
            sqlstr += " where M.form_no = " + Form_No.Text;
            sqlstr += " and M.mat_id = mat.mat_id";
            sqlstr += " and M.Pay_id = p.Pay_Id";
            sqlstr += " and M.Status_id= s.Status_Id";
            sqlstr += " and s.Class='Material'";
            DataTable myTable = mydb.GetDataTable(sqlstr);

            /*讀取登入者名稱*/
            Emp_Id.Text = Session["Emp_Name"].ToString().Trim();
            //日期:讀取資料
            Import_Date.Text = ((DateTime)myTable.Rows[0]["import_date"]).ToString("yyyy-MM-dd");
            //廠商
            Vendor_Id.Text = myTable.Rows[0]["Vendor_Id"].ToString().Trim();
            /*用廠商ID抓名稱*/
            sqlstr           = " select vendor_name from vendor where vendor_id=" + mydb.qo(Vendor_Id.Text);
            Vendor_Name.Text = mydb.getSingleData(0, sqlstr);

            //備註
            sqlstr       = " select comment from Material_Import_Detail where Form_no =" + Form_No.Text;
            Comment.Text = mydb.getSingleData(0, sqlstr);
            //-------------------------


            //Material_Import_Detail
            sqlstr             = "select  d.Form_No as Form_No, d.mat_id as mat_id, m.mat_name as mat_name, d.qty as qty, d.price as price, d.comment as comment ";
            sqlstr            += " from Material_Import_Detail d, Material M ";
            sqlstr            += " where d.form_no = " + Form_No.Text;
            sqlstr            += "   and d.mat_id = m.mat_id ";
            ResGrid.DataSource = mydb.GetDataTable(sqlstr);
            ResGrid.DataBind();
            //Verify
            sqlstr  = "select  s.Status,v.Form_No,v.Emp_Id,v.Verify_Date,v.Comment from Verify v,Status s ";
            sqlstr += " where  v.Form_No = " + Form_No.Text;
            sqlstr += " and v.Status_id = s.Status_Id";
            sqlstr += " and s.Class  ='Material'";

            ProcessGrid.DataSource = mydb.GetDataTable(sqlstr);
            ProcessGrid.DataBind();
        }
Beispiel #3
0
        void showDetail()
        {   //Reserve_Import
            string    sqlstr  = "select * from Reserve_Import where form_no = " + Form_No.Text;
            DataTable myTable = mydb.GetDataTable(sqlstr);

            /*讀取登入者名稱*/
            Emp_Id.Text = mydb.qo(Session["Emp_Name"].ToString());
            //
            string status = myTable.Rows[0]["Status_Id"].ToString().Trim();

            for (int idx = 0; idx < StatusList.Items.Count; idx++)
            {
                if (status == StatusList.Items[idx].Value.Trim())
                {
                    StatusList.SelectedIndex = idx;
                }
            }
            //
            Import_Date.Text = myTable.Rows[0]["Import_Date"].ToString();

            //Import_Date_Est.Text = myTable.Rows[0]["import_date_est"].ToString();
            Import_Date.Text = ((DateTime)myTable.Rows[0]["import_date"]).ToString("yyyy-MM-dd");// DateTime.Now.ToString("yyyy-MM-dd");//myTable.Rows[0]["import_date"].ToString();
            //
            Vendor_Id.Text   = myTable.Rows[0]["Vendor_Id"].ToString().Trim();
            sqlstr           = " select vendor_name from vendor where vendor_id=" + mydb.qo(Vendor_Id.Text);
            Vendor_Name.Text = mydb.getSingleData(0, sqlstr);
            //
            Comment.Text = myTable.Rows[0]["Comment"].ToString().Trim();
            //-------------------------
            //Material_Import_Detail
            sqlstr             = "select  d.Form_No as Form_No, d.mat_id as mat_id, m.mat_name as mat_name, d.qty as qty, d.price as price, d.comment as comment ";
            sqlstr            += " from Material_Import_Detail d, Material M ";
            sqlstr            += " where d.form_no = " + Form_No.Text;
            sqlstr            += "   and d.mat_id = m.mat_id ";
            ResGrid.DataSource = mydb.GetDataTable(sqlstr);
            ResGrid.DataBind();
            //Verify
            sqlstr  = "select  * from Verify ";
            sqlstr += " where form_no = " + Form_No.Text;
            ProcessGrid.DataSource = mydb.GetDataTable(sqlstr);
            ProcessGrid.DataBind();
        }