Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    if (Session["login"].ToString().Equals("") || Session["userLoggedIn"].ToString().Equals(""))
                    {
                        Response.Redirect("~/LoggedInPage.aspx");
                    }
                    else
                    {
                        LoginBO user = (LoginBO)Session["login"];
                        departmentID = user.DepID;

                        if (!IsPostBack)
                        {
                            destinationBL             = new DestinationBL();
                            Session["items"]          = destinationBL.getDisbursementItems(departmentID);
                            disbursementGV.DataSource = Session["items"];
                            disbursementGV.DataBind();
                        }
                    }
                }//End of Ispost backevent
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Пример #2
0
        protected void disbursementGV_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                LoginBO user = (LoginBO)Session["login"];
                departmentID = user.DepID;

                HiddenField hdn = (HiddenField)disbursementGV.Rows[e.RowIndex].FindControl("HiddenField1");
                HiddenField hdf = (HiddenField)disbursementGV.Rows[e.RowIndex].FindControl("HiddenField2");

                int     itemID         = Convert.ToInt32(hdn.Value);
                int     disbursementID = Convert.ToInt32(hdf.Value);
                TextBox txtQuantity    = disbursementGV.Rows[e.RowIndex].Cells[2].Controls[0] as TextBox;
                string  qty            = txtQuantity.Text;
                int     quantity       = Convert.ToInt32(qty);
                destinationBL = new DestinationBL();
                destinationBL.updateDisbursement(departmentID, disbursementID, itemID, quantity);
                disbursementGV.EditIndex = -1;
                Session["items"]         = destinationBL.getDisbursementItems(departmentID);

                //Bind in the gridview
                disbursementGV.DataSource = Session["items"];
                disbursementGV.DataBind();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["userLoggedIn"].Equals("") || Session["login"].Equals(""))
                {
                    Response.Redirect("~/LoggedInPage.aspx");
                }
                else
                {
                    collectionPoint.Text = Session["collectionPoint"].ToString();
                    destinationBL        = new DestinationBL();

                    departmentID = Int32.Parse(Request.QueryString["departmentID"]);
                    string departmentName = destinationBL.getDepartmentName(departmentID);

                    DepartmentName.Text = departmentName;

                    Session["items"]          = destinationBL.getDisbursementItems(departmentID);
                    disbursementGV.DataSource = Session["items"];
                    disbursementGV.DataBind();
                }
            }
        }