예제 #1
0
        private static DataTable BindGridView()
        {
            Class.clsDB DB  = new Class.clsDB();
            string      sql = "select job_id,job_name,create_by,create_date,print_barcode,timestamp1,timestamp2,timestamp3,timestamp4";

            sql += " From job_trailer WHERE show_=1 order by job_id desc";
            DataTable dt;

            dt = DB.ExecuteDataTable(sql);
            DB.Close();
            DB.Dispose();
            return(dt);
        }
예제 #2
0
        private void BindGrid()
        {
            string today = DateTime.Now.ToString("yyyy-MM-dd");

            Class.clsDB DB  = new Class.clsDB();
            string      sql = "select job_id,job_name,place_type,date_format(job_date,'%d/%m/%Y') as job_date,date_format(create_date,'%d/%m/%Y') as create_date,";

            sql += "create_by,print_barcode,date_format(timestamp1,'%H:%i:%s') as timestamp1,date_format(timestamp2,'%H:%i:%s') as timestamp2,";
            sql += "date_format(timestamp3,'%H:%i:%s') as timestamp3,date_format(timestamp4,'%H:%i:%s') as timestamp4";
            sql += " From job_trailer WHERE show_=1 and job_date = '" + today + "' order by job_id desc";
            DataTable dt;

            dt = DB.ExecuteDataTable(sql);
            grid.DataSource = dt;
            // grid.DataKeyNames = "doc_id";
            grid.DataBind();
        }
예제 #3
0
        private void BindGrid()
        {
            Class.clsDB DB  = new Class.clsDB();
            string      sql = "select job_id,job_name,place_type,create_by,date_format(job_date,'%d/%m/%Y') as job_date,";

            sql += " date_format(create_date,'%d/%m/%Y') as create_date,print_barcode,date_format(timestamp1,'%H:%m:%s') as timestamp1,";
            sql += "date_format(timestamp2,'%H:%m:%s') as timestamp2,";
            sql += "date_format(timestamp3,'%H:%m:%s') as timestamp3,date_format(timestamp4,'%H:%m:%s') as timestamp4 From job_trailer where show_=1 order by job_id desc";
            DataTable dt;

            dt = DB.ExecuteDataTable(sql);
            DB.Close();
            DB.Dispose();
            Session["DATATABLE"] = dt;
            grid.DataSource      = dt;
            // grid.DataKeyNames = "doc_id";
            grid.DataBind();
        }
예제 #4
0
        private void BindgridSearch()
        {
            grid.DataSource = null;
            Class.clsDB DB  = new Class.clsDB();
            string      sql = "select job_id,job_name,place_type,create_by,date_format(job_date,'%d/%m/%Y') as job_date,";

            sql += "date_format(create_date,'%d/%m/%Y') as create_date,print_barcode,date_format(timestamp1,'%H:%m:%s') as timestamp1,";
            sql += "date_format(timestamp2,'%H:%m:%s') as timestamp2,date_format(timestamp3,'%H:%m:%s') as timestamp3,";
            sql += "date_format(timestamp4,'%H:%m:%s') as timestamp4 From job_trailer";
            sql += " WHERE (job_id like '" + txtJob.Text + "%' OR job_name like '" + txtJob.Text + "%') AND show_=1";
            sql += " order by job_id desc";
            DataTable dt;

            dt = DB.ExecuteDataTable(sql);
            Session["DATATABLE"] = dt;
            grid.DataSource      = dt;
            // grid.DataKeyNames = "doc_id";
            grid.DataBind();
        }
예제 #5
0
        private void BindGrid()
        {
            string today = DateTime.Now.Date.ToString("yyyy-MM-dd");

            Class.clsDB DB  = new Class.clsDB();
            string      sql = "select job_id,job_name,date_format(job_date,'%d/%m/%Y') as job_date,date_format(create_date,'%d/%m/%Y') as create_date,";

            sql += "create_by,print_barcode,date_format(timestamp1,'%H:%i:%s') as timestamp1,date_format(timestamp2,'%H:%i:%s') as timestamp2,";
            sql += "date_format(timestamp3,'%H:%i:%s') as timestamp3,date_format(timestamp4,'%H:%i:%s') as timestamp4 From job_trailer";
            sql += " WHERE place_type='C' AND show_=1 AND job_date ='" + today + "' ORDER by job_id desc";
            DataTable dt;

            dt = DB.ExecuteDataTable(sql);

            grid.DataSource = dt;

            grid.DataBind();
            DB.Close();
            DB.Dispose();
        }
예제 #6
0
        public string getRuningNoDoc()
        {
            //Format yyyyMMdd-01   2018011501

            clsDB  db  = new clsDB();
            string sql = null;
            string curDate;

            curDate = DateTime.Now.ToString("yyyyMMdd");
            sql     = "Select job_id From job_trailer where job_id like '" + curDate + "%'";
            object    MyScalar = null;
            DataTable dt;

            dt = db.ExecuteDataTable(sql);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    sql      = "Select Max(job_id) + 1 From job_trailer";
                    MyScalar = db.ExecuteScalar(sql);
                    return(MyScalar.ToString());
                }
                else
                {
                    return(curDate.ToString() + "01");
                }
            }


            if (MyScalar != null)
            {
            }
            else
            {
            }


            return(curDate);
        }