コード例 #1
0
    private void ViewMachineReport1(string shift, string unit, string mchn, string process, DateTime frmtm, DateTime totm)
    {
        DBServer db = new DBServer();

        ds = db.departmentreport(shift, unit, mchn, process, frmtm, totm);
        DataSet ds1 = new DataSet();

        ds1 = db.machinereport(shift, unit, mchn, process, frmtm, totm);
        lock (thisLock)
        {
            try{
                if (ds.Tables[0].Rows.Count > 0)
                {
                    grid_process.DataSource = ds.Tables[0];
                    grid_process.DataBind();
                    div_dept_error.Visible = false;
                    DIV_DEPART.Visible     = true;
                    div_exceldept.Visible  = true;
                }
                else
                {
                    div_dept_error.Visible = true;
                    DIV_DEPART.Visible     = false;
                    div_exceldept.Visible  = false;
                    lbl_dept.Text          = "Record Not Found";
                }
                if (ds1.Tables[0].Rows.Count > 0)
                {
                    GridView1.DataSource = ds1.Tables[0];
                    GridView1.DataBind();
                    div_mchn_error.Visible = false;
                    div_machine.Visible    = true;
                    div_excelmac.Visible   = true;
                }
                else
                {
                    div_mchn_error.Visible = true;
                    div_machine.Visible    = false;
                    div_excelmac.Visible   = false;

                    lbl_mchn.Text = "Record Not Found";
                }
            } catch (Exception ex)
            {
                ExceptionLogging.SendExcepToDB(ex);
            }
            finally
            {
            }
        }
    }