protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlCommand cmd = new SqlCommand();


            cmd.CommandText = "select max(work_assign_id)from work_assign";
            a_id            = db.max_id(cmd);


            cmd.CommandText              = "select work_id,work_name from work";
            DropDownList1.DataSource     = db.getData(cmd);
            DropDownList1.DataValueField = "work_id";
            DropDownList1.DataTextField  = "work_name";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "select");


            cmd.CommandText              = "select employee_id,employee_name  from employee_management where emptype='worker'";
            DropDownList2.DataSource     = db.getData(cmd);
            DropDownList2.DataValueField = "employee_id";
            DropDownList2.DataTextField  = "employee_name";
            DropDownList2.DataBind();
            DropDownList2.Items.Insert(0, "select");
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText      = "SELECT parts_request.reqt_id, parts_request.technician_id, employee_management.employee_name, parts_request.mechine_id, mechine_management.mechine_name, parts_request.parts, parts_request.description, parts_request.date,  parts_request.status FROM parts_request INNER JOIN employee_management ON parts_request.technician_id = employee_management.employee_id INNER JOIN mechine_management ON parts_request.mechine_id = mechine_management.mechine_id where parts_request.status='pending'";
        DataGrid1.DataSource = obj.getData(cmd);
        DataGrid1.DataBind();
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText      = "SELECT work_assign.work_id, work_assign.work_assign_id, work.work_name, work_assign.worker_id, work_assign.from_date, work_assign.to_date FROM work_assign INNER JOIN work ON work_assign.work_id = work.work_id where work_assign.worker_id ='" + Session["id"] + "' and work_assign.status='pending'";
        DataGrid1.DataSource = obj.getData(cmd);
        DataGrid1.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText      = "SELECT fault_prediction.mechine_id, fault_prediction.fault_id, mechine_management.mechine_name, fault_prediction.worker_id, fault_prediction.technician_id, employee_management.employee_name, fault_prediction.date, fault_prediction.time, fault_prediction.problem, fault_prediction.status FROM fault_prediction INNER JOIN mechine_management ON fault_prediction.mechine_id = mechine_management.mechine_id INNER JOIN employee_management ON fault_prediction.worker_id = employee_management.employee_id";
        DataGrid1.DataSource = obj.getData(cmd);
        DataGrid1.DataBind();
        MultiView1.SetActiveView(View1);
    }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SqlCommand cmd = new SqlCommand();
         cmd.CommandText      = "SELECT fault_prediction.fault_id, mechine_management.mechine_name, employee_management.employee_name, fault_prediction.date, fault_prediction.time, fault_prediction.problem, fault_prediction.status, fault_prediction.mechine_id,  fault_prediction.worker_id FROM  fault_prediction INNER JOIN mechine_management ON fault_prediction.mechine_id = mechine_management.mechine_id INNER JOIN employee_management ON fault_prediction.worker_id = employee_management.employee_id WHERE  (fault_prediction.technician_id = '" + Session["id"] + "') AND (fault_prediction.status = 'process')";
         DataGrid2.DataSource = obj.getData(cmd);
         DataGrid2.DataBind();
         MultiView1.SetActiveView(View1);
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText      = "select * from employee_management ";
            DataGrid1.DataSource = obj.getData(cmd);
            DataGrid1.DataBind();
            MultiView1.SetActiveView(View1);

            cmd.CommandText = "select max(employee_id)from employee_management";
            id = obj.max_id(cmd);
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText      = "SELECT work_assign.worker_id, employee_management.employee_name, work_assign.work_id, work.work_name, work_assign.work_assign_id, work_assign.from_date, work_assign.to_date, work_assign.status FROM work_assign INNER JOIN employee_management ON work_assign.worker_id = employee_management.employee_id INNER JOIN work ON work_assign.work_id = work.work_id";
        DataGrid1.DataSource = db.getData(cmd);
        DataGrid1.DataBind();
    }
Exemplo n.º 8
0
    public string login(string uname, string pswd)
    {
        string     s   = "";
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from login where username='******' and password='******'";
        DataTable dt = db.getData(cmd);

        if (dt.Rows.Count > 0)
        {
            s = dt.Rows[0][0].ToString() + "#" + dt.Rows[0][3].ToString();
        }
        else
        {
            s = "error";
        }
        return(s);
    }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MultiView1.SetActiveView(View1);
         SqlCommand cmd = new SqlCommand();
         cmd.CommandText      = "SELECT complaints.employee_id, employee_management.employee_name, complaints.cmp_id, complaints.type, complaints.complaints, complaints.reply, complaints.date FROM complaints INNER JOIN employee_management ON complaints.employee_id = employee_management.employee_id where complaints.reply='pending'";
         DataGrid1.DataSource = obj.getData(cmd);
         DataGrid1.DataBind();
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText      = "select * from mechine_management ";
            DataGrid1.DataSource = obj.getData(cmd);
            DataGrid1.DataBind();
            MultiView1.SetActiveView(View1);

            cmd.CommandText = "select max(mechine_id)from mechine_management";
            mid             = obj.max_id(cmd);

            cmd.CommandText              = "select distinct department from employee_management";
            DropDownList1.DataSource     = obj.getData(cmd);
            DropDownList1.DataValueField = "department";
            DropDownList1.DataTextField  = "department";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "select");

            cmd.CommandText              = "select department  from employee_management";
            DropDownList2.DataSource     = obj.getData(cmd);
            DropDownList2.DataValueField = "department";
            DropDownList2.DataTextField  = "department";
            DropDownList2.DataBind();
            DropDownList2.Items.Insert(0, "select");
        }
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText      = "select * from complaints where type='Technician' and employee_id= '" + Session["id"] + "'";
            DataGrid2.DataSource = obj.getData(cmd);
            DataGrid2.DataBind();
            MultiView1.SetActiveView(View2);

            cmd.CommandText = "select max(cmp_id)from complaints";
            id = obj.max_id(cmd);

            cmd.CommandText = "select employee_name from employee_management where employee_id='" + Session["id"] + "'";
            DataTable dt = obj.getData(cmd);
            if (dt.Rows.Count > 0)
            {
                TextBox4.Text = dt.Rows[0][0].ToString();
            }
            TextBox3.Text = DateTime.Now.ToShortDateString();
        }
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MultiView1.SetActiveView(View1);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "select max(fault_id)from fault_prediction";
            id = db.max_id(cmd);


            cmd.CommandText              = "select mechine_id,mechine_name  from mechine_management";
            DropDownList1.DataSource     = db.getData(cmd);
            DropDownList1.DataValueField = "mechine_id";
            DropDownList1.DataTextField  = "mechine_name";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "select");

            cmd.CommandText              = "select employee_id,employee_name  from employee_management where emptype='worker'";
            DropDownList4.DataSource     = db.getData(cmd);
            DropDownList4.DataValueField = "employee_id";
            DropDownList4.DataTextField  = "employee_name";
            DropDownList4.DataBind();
            DropDownList4.Items.Insert(0, "select");


            cmd.CommandText              = "select employee_id,employee_name  from employee_management where emptype='technician'";
            DropDownList3.DataSource     = db.getData(cmd);
            DropDownList3.DataValueField = "employee_id";
            DropDownList3.DataTextField  = "employee_name";
            DropDownList3.DataBind();
            DropDownList3.Items.Insert(0, "select");

            cmd.CommandText      = "select * from fault_prediction";
            DataGrid1.DataSource = db.getData(cmd);
            DataGrid1.DataBind();
        }
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MultiView1.SetActiveView(View1);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "select max(reqt_id)from parts_request";
            id = db.max_id(cmd);

            cmd.CommandText      = "SELECT parts_request.mechine_id, parts_request.reqt_id, parts_request.technician_id, parts_request.parts, parts_request.description, parts_request.date, parts_request.status, mechine_management.mechine_name FROM parts_request INNER JOIN mechine_management ON parts_request.mechine_id = mechine_management.mechine_id where parts_request.status='pending' and parts_request.technician_id='" + Session["id"] + "'";
            DataGrid1.DataSource = db.getData(cmd);
            DataGrid1.DataBind();


            cmd.CommandText              = "select mechine_id,mechine_name  from mechine_management";
            DropDownList1.DataSource     = db.getData(cmd);
            DropDownList1.DataValueField = "mechine_id";
            DropDownList1.DataTextField  = "mechine_name";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "select");

            TextBox3.Text = System.DateTime.Now.ToShortDateString();
        }
    }