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"))
        {
            InventoryLogic iil = new InventoryLogic();
            Inventory c1 = iil.SelectByID(Convert.ToInt32(Request.QueryString["id"]));
            RawMaterialLogic rrl = new RawMaterialLogic();
            RawMaterial r1 = rrl.SelectByID(c1.RawMaterialID);

            if (c1 != null)
            {

                Label1.Text = r1.Name;
                Label2.Text = c1.Quantity.ToString();
                Label3.Text = c1.TrDate.ToString();
                Label4.Text = c1.Remarks;

            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee      e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));

        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            RawMaterialLogic rl = new RawMaterialLogic();
            RawMaterial      r1 = rl.SelectByID(Convert.ToInt32(e.CommandArgument));
            if (r1 != null)
            {
                int i = rl.Delete(r1.RawMaterialID);
                if (i == 1)
                {
                    Response.Redirect("RawMatList.aspx");
                }
                else
                {
                    Response.Redirect("CustomerList.aspx");
                }
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
Example #3
0
    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"))
        {
            InventoryLogic   iil = new InventoryLogic();
            Inventory        c1  = iil.SelectByID(Convert.ToInt32(Request.QueryString["id"]));
            RawMaterialLogic rrl = new RawMaterialLogic();
            RawMaterial      r1  = rrl.SelectByID(c1.RawMaterialID);

            if (c1 != null)
            {
                Label1.Text = r1.Name;
                Label2.Text = c1.Quantity.ToString();
                Label3.Text = c1.TrDate.ToString();
                Label4.Text = c1.Remarks;
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void btnUpload_OnClick(object sender, EventArgs e)
    {

        string invids = Session["invids"].ToString();
        string[] arr = invids.Split(',');
        InventoryLogic il = new InventoryLogic();
        RawMaterialLogic rl = new RawMaterialLogic();
        GRNLogic gl = new GRNLogic();
        GRN g = new GRN();
        g.SupplierID = rl.SelectByID(il.SelectByID(Convert.ToInt32(arr[0])).RawMaterialID).SupplierID;
        string path;
        string ticks = DateTime.Now.Ticks.ToString();
        Inventory inv;
        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath("Images/" + ticks + FileUpload1.FileName));
            path = "Images/" + ticks + FileUpload1.FileName;
            g.GRNPath = path;
            int id =  gl.Insert(g);
            
            for (int i = 0; i < arr.Length; i++)
            {
                inv = il.SelectByID(Convert.ToInt32(arr[i]));
                inv.GRNID = id;
                il.Update(inv);
                //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage" + arr[i], "alert(" + arr[i] + ")", true);
            }

        }
        // Response.Redirect("QuotationList.aspx");
        Response.Redirect("InventoryList.aspx");

    }
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            RawMaterialLogic rl = new RawMaterialLogic();
            RawMaterial r1 = rl.SelectByID(Convert.ToInt32(e.CommandArgument));
            if (r1 != null)
            {
                int i = rl.Delete(r1.RawMaterialID);
                if (i==1)
                {
                    Response.Redirect("RawMatList.aspx");
                }
                else
                {
                    Response.Redirect("CustomerList.aspx");
                }
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }

    }
Example #6
0
    protected void btnUpload_OnClick(object sender, EventArgs e)
    {
        string invids = Session["invids"].ToString();

        string[]         arr = invids.Split(',');
        InventoryLogic   il  = new InventoryLogic();
        RawMaterialLogic rl  = new RawMaterialLogic();
        GRNLogic         gl  = new GRNLogic();
        GRN g = new GRN();

        g.SupplierID = rl.SelectByID(il.SelectByID(Convert.ToInt32(arr[0])).RawMaterialID).SupplierID;
        string    path;
        string    ticks = DateTime.Now.Ticks.ToString();
        Inventory inv;

        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath("Images/" + ticks + FileUpload1.FileName));
            path      = "Images/" + ticks + FileUpload1.FileName;
            g.GRNPath = path;
            int id = gl.Insert(g);

            for (int i = 0; i < arr.Length; i++)
            {
                inv       = il.SelectByID(Convert.ToInt32(arr[i]));
                inv.GRNID = id;
                il.Update(inv);
                //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage" + arr[i], "alert(" + arr[i] + ")", true);
            }
        }
        // Response.Redirect("QuotationList.aspx");
        Response.Redirect("InventoryList.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 (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"))
        {
            if (!IsPostBack)
            {
                if (Convert.ToInt32(Request.QueryString["id"]) > 0)
                {
                
                    RawMaterialLogic rl = new RawMaterialLogic();
                    RawMaterial r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"]));
                    TextBox2.Text = r1.Name;
                    TextBox3.Text = r1.Code.ToString();
                    TextArea1.Text = r1.Descrition;
                    TextBox4.Text = r1.Unit;
                    TextBox5.Text = r1.MinQuantity.ToString();
                    SupplierLogic sl = new SupplierLogic();
                    DropDownList1.DataSource = sl.SelectAll();
                    DropDownList1.DataTextField = "Name";
                    DropDownList1.DataValueField = "SupplierID";
                    DropDownList1.DataBind();
                    Supplier s = sl.SelectByID(r1.SupplierID);
                    DropDownList1.SelectedItem.Text = s.Name;
                    DropDownList2.SelectedItem.Text = r1.Category;
                    DropDownList3.SelectedItem.Text = r1.Type;
                }


                else
                {
                
                    SupplierLogic sl = new SupplierLogic();
                    DropDownList1.DataSource = sl.SelectAll();
                    DropDownList1.DataTextField = "Name";
                    DropDownList1.DataValueField = "SupplierID";
                    DropDownList1.DataBind();
                }

            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }


    }
 protected void Button1_Click(object sender, EventArgs e)
 {
     RawMaterialLogic rl = new RawMaterialLogic();
     DataTable dt = rl.Search(TextBox1.Text,DropDownList1.SelectedItem.Text,Convert.ToInt32(DropDownList2.SelectedItem.Value));
     Repeater1.DataSource = dt;
     Repeater1.DataBind();
     if (dt.Rows.Count == 0)
     {
         Table1.Visible = false;
         Label1.Visible = true;
     }
     else
     {
         Table1.Visible = true;
         Label1.Visible = false;
     }
 }
    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"))
        {
            if (!IsPostBack)
            {
                if (Convert.ToInt32(Request.QueryString["id"]) > 0)
                {
                    RawMaterialLogic rl = new RawMaterialLogic();
                    RawMaterial      r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"]));
                    TextBox2.Text  = r1.Name;
                    TextBox3.Text  = r1.Code.ToString();
                    TextArea1.Text = r1.Descrition;
                    TextBox4.Text  = r1.Unit;
                    TextBox5.Text  = r1.MinQuantity.ToString();
                    SupplierLogic sl = new SupplierLogic();
                    DropDownList1.DataSource     = sl.SelectAll();
                    DropDownList1.DataTextField  = "Name";
                    DropDownList1.DataValueField = "SupplierID";
                    DropDownList1.DataBind();
                    Supplier s = sl.SelectByID(r1.SupplierID);
                    DropDownList1.SelectedItem.Text = s.Name;
                    DropDownList2.SelectedItem.Text = r1.Category;
                    DropDownList3.SelectedItem.Text = r1.Type;
                }


                else
                {
                    SupplierLogic sl = new SupplierLogic();
                    DropDownList1.DataSource     = sl.SelectAll();
                    DropDownList1.DataTextField  = "Name";
                    DropDownList1.DataValueField = "SupplierID";
                    DropDownList1.DataBind();
                }
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RawMaterialLogic rl = new RawMaterialLogic();
        DataTable        dt = rl.Search(TextBox1.Text, DropDownList1.SelectedItem.Text, Convert.ToInt32(DropDownList2.SelectedItem.Value));

        Repeater1.DataSource = dt;
        Repeater1.DataBind();
        if (dt.Rows.Count == 0)
        {
            Table1.Visible = false;
            Label1.Visible = true;
        }
        else
        {
            Table1.Visible = true;
            Label1.Visible = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            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"))
            {
                RawMaterialLogic rl = new RawMaterialLogic();
                RawMaterial r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"]));

                SupplierLogic sl = new SupplierLogic();


                if (r1 != null)
                {

                    Label1.Text = r1.Name;
                    Label2.Text = r1.Code.ToString();
                    Label3.Text = r1.Descrition;
                    Label4.Text = r1.Unit;
                    Label5.Text = r1.MinQuantity.ToString();
                    Supplier s1 = sl.SelectByID(r1.SupplierID);
                    if (s1 != null)
                    {
                        Label6.Text = s1.Name;
                    }
                    else
                    {
                        Label6.Text = "-----";
                    }
                    Label7.Text = r1.Category;
                    Label8.Text = r1.Type;

                }
            }
            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();
         * }*/
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if ((Convert.ToInt32(Request.QueryString["id"])) > 0)
        {

            RawMaterialLogic rl = new RawMaterialLogic();
            RawMaterial r1 = new RawMaterial();
            r1.Name = TextBox2.Text;
            r1.Code = Convert.ToInt32(TextBox3.Text);
            r1.Unit = TextBox4.Text;
            r1.MinQuantity = Convert.ToInt32(TextBox5.Text);
            r1.Descrition = TextArea1.Text;
            r1.Category = DropDownList2.SelectedItem.Text;
            r1.Type = DropDownList3.SelectedItem.Text;
            r1.SupplierID = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            r1.RawMaterialID = Convert.ToInt32(Request.QueryString["id"]);
            
            rl.Update(r1);

            Response.Redirect("RawMatList.aspx");
        }
        else
        {
            RawMaterialLogic rl = new RawMaterialLogic();
            RawMaterial r1 = new RawMaterial();
            r1.Name = TextBox2.Text;
            r1.Code = Convert.ToInt32(TextBox3.Text);
            r1.Unit = TextBox4.Text;
            r1.MinQuantity = Convert.ToInt32(TextBox5.Text);
            r1.Descrition = TextArea1.Text;
            r1.Category = DropDownList2.SelectedItem.Text;
            r1.Type = DropDownList3.SelectedItem.Text;
            r1.SupplierID = Convert.ToInt32(DropDownList1.SelectedItem.Value);

            //r1.RawMaterialID = Convert.ToInt32(Request.QueryString["id"]);
           
            rl.Insert(r1);

            Response.Redirect("RawMatList.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if ((Convert.ToInt32(Request.QueryString["id"])) > 0)
        {
            RawMaterialLogic rl = new RawMaterialLogic();
            RawMaterial      r1 = new RawMaterial();
            r1.Name          = TextBox2.Text;
            r1.Code          = Convert.ToInt32(TextBox3.Text);
            r1.Unit          = TextBox4.Text;
            r1.MinQuantity   = Convert.ToInt32(TextBox5.Text);
            r1.Descrition    = TextArea1.Text;
            r1.Category      = DropDownList2.SelectedItem.Text;
            r1.Type          = DropDownList3.SelectedItem.Text;
            r1.SupplierID    = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            r1.RawMaterialID = Convert.ToInt32(Request.QueryString["id"]);

            rl.Update(r1);

            Response.Redirect("RawMatList.aspx");
        }
        else
        {
            RawMaterialLogic rl = new RawMaterialLogic();
            RawMaterial      r1 = new RawMaterial();
            r1.Name        = TextBox2.Text;
            r1.Code        = Convert.ToInt32(TextBox3.Text);
            r1.Unit        = TextBox4.Text;
            r1.MinQuantity = Convert.ToInt32(TextBox5.Text);
            r1.Descrition  = TextArea1.Text;
            r1.Category    = DropDownList2.SelectedItem.Text;
            r1.Type        = DropDownList3.SelectedItem.Text;
            r1.SupplierID  = Convert.ToInt32(DropDownList1.SelectedItem.Value);

            //r1.RawMaterialID = Convert.ToInt32(Request.QueryString["id"]);

            rl.Insert(r1);

            Response.Redirect("RawMatList.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            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"))
            {
                RawMaterialLogic rl = new RawMaterialLogic();
                RawMaterial      r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"]));

                SupplierLogic sl = new SupplierLogic();


                if (r1 != null)
                {
                    Label1.Text = r1.Name;
                    Label2.Text = r1.Code.ToString();
                    Label3.Text = r1.Descrition;
                    Label4.Text = r1.Unit;
                    Label5.Text = r1.MinQuantity.ToString();
                    Supplier s1 = sl.SelectByID(r1.SupplierID);
                    if (s1 != null)
                    {
                        Label6.Text = s1.Name;
                    }
                    else
                    {
                        Label6.Text = "-----";
                    }
                    Label7.Text = r1.Category;
                    Label8.Text = r1.Type;
                }
            }
            else
            {
                Response.Redirect("Access.aspx");
            }
        }
    }