protected void Page_Load(object sender, EventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee      e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));

        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE"))
        {
            if (!IsPostBack)
            {
                RawMaterialLogic RL = new RawMaterialLogic();
                DataTable        dt = RL.SelectAllJoined();
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
                if (dt.Rows.Count == 0)
                {
                    Table1.Visible = false;
                    Label1.Visible = true;
                }
                else
                {
                    Table1.Visible = true;
                    Label1.Visible = false;
                }

                RawMaterialLogic rl  = new RawMaterialLogic();
                DataTable        dt1 = rl.SelectAll();
                dt1.Rows.Add(0, null, null, null, null, null, null, "All Category", null);
                dt1.DefaultView.Sort         = "SupplierID";
                DropDownList1.DataSource     = dt1;
                DropDownList1.DataTextField  = "Category";
                DropDownList1.DataValueField = "SupplierID";
                //DropDownList1.DataBind();
                DropDownList1.SelectedItem.Text = "All Category";

                SupplierLogic sl  = new SupplierLogic();
                DataTable     dt2 = sl.SelectAll();
                dt2.Rows.Add(0, "All Supplier", null, null, null);
                dt2.DefaultView.Sort         = "SupplierID";
                DropDownList2.DataSource     = dt2;
                DropDownList2.DataTextField  = "Name";
                DropDownList2.DataValueField = "SupplierID";
                DropDownList2.DataBind();
                DropDownList2.SelectedItem.Text = "All Supplier";
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
         EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE"))
        {
            if (!IsPostBack)
            {
                RawMaterialLogic RL = new RawMaterialLogic();
                DataTable dt = RL.SelectAllJoined();
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
                if (dt.Rows.Count == 0)
                {
                    Table1.Visible = false;
                    Label1.Visible = true;
                }
                else
                {
                    Table1.Visible = true;
                    Label1.Visible = false;
                }

                RawMaterialLogic rl = new RawMaterialLogic();
                DataTable dt1 = rl.SelectAll();
                dt1.Rows.Add(0, null, null, null, null, null, null, "All Category", null);
                dt1.DefaultView.Sort = "SupplierID";
                DropDownList1.DataSource = dt1;
                DropDownList1.DataTextField = "Category";
                DropDownList1.DataValueField = "SupplierID";
                //DropDownList1.DataBind();
                DropDownList1.SelectedItem.Text = "All Category";

                SupplierLogic sl = new SupplierLogic();
                DataTable dt2 = sl.SelectAll();
                dt2.Rows.Add(0, "All Supplier", null, null, null);
                dt2.DefaultView.Sort = "SupplierID";
                DropDownList2.DataSource = dt2;
                DropDownList2.DataTextField = "Name";
                DropDownList2.DataValueField = "SupplierID";
                DropDownList2.DataBind();
                DropDownList2.SelectedItem.Text = "All Supplier";
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        
            if (!IsPostBack)
            {
                if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
                {
                RawMaterialLogic rl = new RawMaterialLogic();
                DropDownList1.DataSource = rl.SelectAll();
                DropDownList1.DataTextField = "Name";
                DropDownList1.DataValueField = "RawMaterialID";
                DropDownList1.DataBind();

                InventoryLogic il = new InventoryLogic();
                Inventory i1 = il.SelectByID(Convert.ToInt32(Request.QueryString["ID"]));
                if (i1.InventoryID > 0)
                {
                    RawMaterial r1 = rl.SelectByID(i1.RawMaterialID);
                    DropDownList1.SelectedItem.Value = r1.RawMaterialID.ToString();
                    TextBox1.Text = i1.Quantity.ToString();
                    TextBox2.Text = i1.TrDate.ToString("dd/MM/yyyy");
                    TextBox3.Text = i1.Remarks;
                }
            }
            else
            {
                Response.Redirect("Access.aspx");
            }
        }
          /*  else
            {
                RawMaterialLogic rl = new RawMaterialLogic();
                DropDownList1.DataSource = rl.SelectAll();
                DropDownList1.DataTextField = "Name";
                DropDownList1.DataValueField = "RawMaterialID";
                DropDownList1.DataBind();
            }*/
       
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee      e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));

        if (!IsPostBack)
        {
            if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
            {
                RawMaterialLogic rl = new RawMaterialLogic();
                DropDownList1.DataSource     = rl.SelectAll();
                DropDownList1.DataTextField  = "Name";
                DropDownList1.DataValueField = "RawMaterialID";
                DropDownList1.DataBind();

                InventoryLogic il = new InventoryLogic();
                Inventory      i1 = il.SelectByID(Convert.ToInt32(Request.QueryString["ID"]));
                if (i1.InventoryID > 0)
                {
                    RawMaterial r1 = rl.SelectByID(i1.RawMaterialID);
                    DropDownList1.SelectedItem.Value = r1.RawMaterialID.ToString();
                    TextBox1.Text = i1.Quantity.ToString();
                    TextBox2.Text = i1.TrDate.ToString("dd/MM/yyyy");
                    TextBox3.Text = i1.Remarks;
                }
            }
            else
            {
                Response.Redirect("Access.aspx");
            }
        }

        /*  else
         * {
         *    RawMaterialLogic rl = new RawMaterialLogic();
         *    DropDownList1.DataSource = rl.SelectAll();
         *    DropDownList1.DataTextField = "Name";
         *    DropDownList1.DataValueField = "RawMaterialID";
         *    DropDownList1.DataBind();
         * }*/
    }