Ejemplo n.º 1
0
 protected void damageButton_Click(object sender, EventArgs e)
 {
     if (allItemGridView.Rows.Count > 0)
     {
         List <StockOutModel> aStockList = (List <StockOutModel>)ViewState["aStockListVS"];
         foreach (StockOutModel aStock in aStockList)
         {
             StockOutModel aStockOut = new StockOutModel();
             aStockOut.ItemId            = aStock.ItemId;
             aStockOut.Quantity          = aStock.Quantity;
             aStockOut.Date              = aStock.Date;
             aStockOut.Type              = "DAMAGE";
             aStockOut.RemainningQuanity = aStock.RemainningQuanity;
             stockOutManager.UpdateQuantityFromStockOut(aStockOut);
             string message = stockOutManager.Damage(aStockOut);
             if (message == "Damage Successfull")
             {
                 ClientScript.RegisterStartupScript(this.GetType(), "yess!", "DamageMsg()", true);
                 allItemGridView.DataSource = null;
                 ViewState["aStockListVS"]  = null;
                 allItemGridView.DataBind();
                 ClearBox();
             }
         }
     }
     else
     {
         ClientScript.RegisterStartupScript(this.GetType(), "Oops!", "ErrorMsg()", true);
     }
 }
Ejemplo n.º 2
0
        protected void damageButton_Click(object sender, EventArgs e)
        {
            List <StockOut> stockOutList = (List <StockOut>)ViewState["gridVS"];

            outputLabel.Text = stockOutManager.Damage(stockOutList);
            ClearGrid();
            Response.Redirect("StockOutUI.aspx");
        }