Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Datagridfunctions ds = new Datagridfunctions();


        string type = (string)HttpContext.Current.Session["user_type"];

        if (type == "ENG")
        {
            DataGridPre.DataSource = ds.searchpreengineer();
        }
        else
        {
            DataGridPre.DataSource = ds.searchpre();
        }
        DataGridPre.DataBind();

        if (type != "MGR")
        {
            if (type != "TL" && CheckBox1.Checked == true)
            {
                hide(Convert.ToInt32(DropDownList1.SelectedValue));
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Datagridfunctions ds = new Datagridfunctions();
         DataGridOpenEmployee.DataSource = ds.getbookedactivities();
         DataGridOpenEmployee.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Datagridfunctions ds = new Datagridfunctions();
         DataGridCloseEmployee.DataSource = ds.getactivitydataopen();
         DataGridCloseEmployee.DataBind();
     }
 }
Exemple #4
0
    private void databinding()
    {
        Datagridfunctions ds  = new Datagridfunctions();
        SqlDataReader     rdr = ds.getactivitydata();

        DataGridEmployee.DataSource = ds.getactivitydata();

        DataGridEmployee.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Datagridfunctions ds = new Datagridfunctions();
        string            ty = (string)HttpContext.Current.Session["user_type"];
        int tyi;

        if (ty == "MGR")
        {
            tyi = 1;
            CheckBox2.Visible = false;
            CheckBox2.Checked = false;
        }
        else
        {
            tyi = 0;
        }
        if (!IsPostBack)
        {
            CheckBox1.Checked            = false;
            CheckBox2.Checked            = false;
            DropDownList1.DataSource     = ds.getemployeecode();
            DropDownList1.DataTextField  = "Employee_Code";
            DropDownList1.DataValueField = "Employee_Code";
            DropDownList1.DataBind();
            DataGridEmpCode.DataSource = ds.getactivityemp(DropDownList1.SelectedValue);
            DataGridEmpCode.DataBind();
        }

        if (CheckBox2.Checked == true && tyi == 0)
        {
            Label1.Visible             = false;
            DropDownList1.Visible      = false;
            CheckBox1.Visible          = false;
            DataGridEmpCode.DataSource = null;
            DataGridEmpCode.DataSource = ds.getactivityown();
            DataGridEmpCode.DataBind();
        }
        else
        {
            Label1.Visible             = true;
            DropDownList1.Visible      = true;
            CheckBox1.Visible          = true;
            DataGridEmpCode.DataSource = ds.getactivityemp(DropDownList1.SelectedValue);
            DataGridEmpCode.DataBind();
            if (CheckBox1.Checked == true)
            {
                hide(Convert.ToInt32(DropDownList2.SelectedValue));
            }
            else
            {
            }
        }
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Datagridfunctions ds          = new Datagridfunctions();
        string            selectedemp = DropDownList1.SelectedValue;

        DataGridEmpCode.DataSource = null;
        DataGridEmpCode.DataSource = ds.getactivityemp(DropDownList1.SelectedValue);
        DataGridEmpCode.DataBind();
        if (CheckBox1.Checked == true)
        {
            hide(Convert.ToInt32(DropDownList2.SelectedValue));
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     Label2.Visible = false;
     if (!IsPostBack)
     {
         Datagridfunctions ds = new Datagridfunctions();
         DataGrid1.DataSource = ds.getactivitybooktl();
         DataGrid1.DataBind();
         TextBox1.Visible = true;
         TextBox2.Visible = false;
         Button1.Visible  = false;
         // Button2.Visible = false;
         Single_Engineer.Checked = true;
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int count = 0;

        while (count < DataGridOpenEmployee.Items.Count)
        {
            CheckBox checkbooking = (CheckBox)DataGridOpenEmployee.Items[count].FindControl("CloseBooking_Checkbox");
            Label    activitycode = (Label)DataGridOpenEmployee.Items[count].FindControl("Activity_Code_Close");
            Label    employeecode = (Label)DataGridOpenEmployee.Items[count].FindControl("Employee_Code_Close");
            if (checkbooking.Checked == true)
            {
                Datagridfunctions ds = new Datagridfunctions();
                ds.startbookedactivity(activitycode.Text);
            }
            count++;
        }
        Response.Redirect("Home_Screen.aspx?");
    }
Exemple #9
0
    protected void Update_Click(object sender, EventArgs e)
    {
        int count = 0;

        while (count < DataGridEmployee.Items.Count)
        {
            DataGridEmployee.Items[count].FindControl("Book_Checkbox");
            int      x            = DataGridEmployee.CurrentPageIndex;
            CheckBox checkbooking = (CheckBox)DataGridEmployee.Items[count].FindControl("Book_Checkbox");
            Label    activitycode = (Label)DataGridEmployee.Items[count].FindControl("Activity_Code");
            if (checkbooking.Checked == true)
            {
                Datagridfunctions ds = new Datagridfunctions();
                ds.openbooking(activitycode.Text);
                ds.changestatus(activitycode.Text, 'O');
            }
            count++;
        }
        Response.Redirect("Home_Screen.aspx?");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        int x = 1;

        if (Single_Engineer.Checked == true)
        {
            if (TextBox1.Text != "")
            {
                Datagridfunctions ds = new Datagridfunctions();
                if (ds.checkemployid(TextBox1.Text))
                {
                    int count = 0;
                    while (count < DataGrid1.Items.Count)
                    {
                        CheckBox checkbooking = (CheckBox)DataGrid1.Items[count].FindControl("Book_Checkbox_Book_TL");
                        Label    activitycode = (Label)DataGrid1.Items[count].FindControl("Activity_Code_Book_TL");
                        if (checkbooking.Checked == true)
                        {
                            ds.openbookingtl(TextBox1.Text, activitycode.Text);
                        }
                        count++;
                    }
                }

                else
                {
                    Label2.Visible = true;
                    Label2.Text   += Convert.ToString(TextBox1.Text) + "  " + "not a valid Employee Code";
                    x = 0;
                }
            }
        }
        else
        {
            Datagridfunctions ds      = new Datagridfunctions();
            string[]          checkid = gangid.Split('+');

            for (int i = 1; i < checkid.Length; i++)
            {
                if (ds.checkemployid(checkid[i]))
                {
                }
                else
                {
                    x = 0;
                    Label2.Visible = true;
                    Label2.Text   += checkid[i] + "  " + "not a valid Employee Code. ";
                }
            }


            if (gangid != "" & x == 1)
            {
                int count = 0;
                while (count < DataGrid1.Items.Count)
                {
                    CheckBox checkbooking = (CheckBox)DataGrid1.Items[count].FindControl("Book_Checkbox_Book_TL");
                    Label    activitycode = (Label)DataGrid1.Items[count].FindControl("Activity_Code_Book_TL");
                    if (checkbooking.Checked == true)
                    {
                        ds.opengangbooking(gangid, activitycode.Text);
                    }
                    count++;
                }
            }
        }

        if (x == 1)
        {
            Response.Redirect("Home_Screen.aspx?");
            gangid = "";
        }
    }
 protected void Button2_Click(object sender, EventArgs e)
 {
     Datagridfunctions ds = new Datagridfunctions();
 }