Example #1
0
 private void GvShipper_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (Session["shippers"] != null)
     {
         ShipperList shippers = (ShipperList)Session["shippers"];
         Shipper     shipper  = shippers.List[e.RowIndex];
         shipper.Deleted = true;
         shipper.Save();
     }
     gvShipper.EditIndex = -1;
     getAll();
 }
Example #2
0
        private void GvShipper_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            TextBox    txtCompanyName = (TextBox)gvShipper.Rows[e.RowIndex].FindControl("txtCompanyName");
            TextBox    txtPhone       = (TextBox)gvShipper.Rows[e.RowIndex].FindControl("txtPhone");
            FileUpload fu             = (FileUpload)gvShipper.Rows[e.RowIndex].FindControl("fileupload1");

            if (Session["shippers"] != null)
            {
                ShipperList shippers = (ShipperList)Session["shippers"];
                Shipper     shipper  = shippers.List[e.RowIndex];
                shipper.CompanyName      = txtCompanyName.Text;
                shipper.Phone            = txtPhone.Text;
                shipper.FullPathfileName = Path.Combine(Server.MapPath("Files"), fu.FileName);
                shipper.Image            = fu.FileBytes;
                shipper.Save();
            }
            gvShipper.EditIndex = -1;
            getAll();
        }