Ejemplo n.º 1
0
        protected void reasonTB_TextChanged(object sender, EventArgs e)
        {
            GridViewRow gridViewRow           = (GridViewRow)(sender as Control).Parent.Parent;
            TextBox     reasonTB              = (TextBox)sender;
            Label       rowIndex              = (Label)gridViewRow.FindControl("rowIndex");
            int         index                 = int.Parse(rowIndex.Text) - 1;
            List <MonthlyCheckModel> itemList = (List <MonthlyCheckModel>)Session["DisDetail"];

            itemList[index].Reason = reasonTB.Text;

            Session["DisDetail"]         = itemList;
            FileDiscrepencyGV.DataSource = itemList;
            FileDiscrepencyGV.DataBind();
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            context = new SSISEntities();

            List <MonthlyCheckModel> modelList;
            Dictionary <string, int> SessionInfo;

            if (!IsPostBack)
            {
                modelList   = new List <MonthlyCheckModel>();
                SessionInfo = (Dictionary <string, int>)Session[PUBLIC_SESSION_DISCREPANCY_DICT];

                // Early quit if no session
                if (SessionInfo == null)
                {
                    lblWarning.Text    = "No discrepancies to be filed.";
                    ConfirmBtn.Visible = false;
                    return;
                }

                lblWarning.Visible = false;

                foreach (KeyValuePair <string, int> pair in SessionInfo)
                {
                    string itemCode    = pair.Key;
                    int    qtyAdjusted = pair.Value;

                    Stock_Inventory inventory = context.Stock_Inventory.Where(x => x.item_code == itemCode).ToList().First();

                    MonthlyCheckModel model = new MonthlyCheckModel(inventory);
                    model.ActualQuantity = model.CurrentQuantity - qtyAdjusted;
                    modelList.Add(model);
                }

                Session["DisDetail"] = modelList;

                FileDiscrepencyGV.DataSource = modelList;
                FileDiscrepencyGV.DataBind();
            }
        }