コード例 #1
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 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");
        }
    }
    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");
        }

    }
コード例 #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"))
        {
            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 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 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 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");
            }
        }
    }