protected void GVStockMenorSafety_Sorting(object sender, GridViewSortEventArgs e) { if (OrderField == e.SortExpression) { ChangeOrder(); } OrderField = e.SortExpression; List <AlertProduct> lstStockMenorSafety = ControllerManager.AlertProduct.ShowAlert(OrderField, sortOrder, 2); GVStockMenorSafety.DataSource = lstStockMenorSafety; GVStockMenorSafety.DataBind(); GVStockMenorSafety.Enabled = true; }
protected void GVStockMenorSafety_PageIndexChanging(object sender, GridViewPageEventArgs e) { GVStockMenorSafety.PageIndex = e.NewPageIndex; GVStockMenorSafety.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["sortOrder"] = ""; } if (Request.QueryString["alert"] != null) { List <Provider> providers = ControllerManager.Provider.GetFullProviderList(); switch (Request.QueryString["alert"]) { case "1": { lblAlertName.Text = "OC Confirmadas y No Entregadas"; List <AlertPurchaseOrder> lstConfNoEntregadas = ControllerManager.AlertPurchaseOrder.ShowAlert1(); foreach (AlertPurchaseOrder order in lstConfNoEntregadas) { Provider provtemp = providers.Find(delegate(Provider record) { if (record.ProviderCode == order.PurchaseOrderProviderCode) { return(true); } return(false); }); if (provtemp != null) { order.PurchaseOrderProviderName = provtemp.Name; } } GVOcConfirmadasNoEntregadas.DataSource = lstConfNoEntregadas; GVOcConfirmadasNoEntregadas.DataBind(); GVOcConfirmadasNoEntregadas.Enabled = true; btnExportToExcel.Visible = (lstConfNoEntregadas.Count > 0); break; } case "2": { lblAlertName.Text = "OC No Confirmadas"; List <AlertPurchaseOrder> lstNoConfirmadas = ControllerManager.AlertPurchaseOrder.ShowAlert2(); foreach (AlertPurchaseOrder order in lstNoConfirmadas) { Provider provtemp = providers.Find(delegate(Provider record) { if (record.ProviderCode == order.PurchaseOrderProviderCode) { return(true); } return(false); }); if (provtemp != null) { order.PurchaseOrderProviderName = provtemp.Name; } } GVOcNoConfirmadas.DataSource = lstNoConfirmadas; GVOcNoConfirmadas.DataBind(); GVOcNoConfirmadas.Enabled = true; btnExportToExcel.Visible = (lstNoConfirmadas.Count > 0); break; } case "3": { lblAlertName.Text = "Productos con Stock Negativo"; List <AlertProduct> lstStockNegativo = ControllerManager.AlertProduct.ShowAlert3(); GVStockNegativo.DataSource = lstStockNegativo; GVStockNegativo.DataBind(); GVStockNegativo.Enabled = true; btnExportToExcel.Visible = (lstStockNegativo.Count > 0); break; } case "4": { lblAlertName.Text = "OV no Cumplimentadas"; List <AlertSaleOrder> lstNoCumplimentadas = ControllerManager.AlertSaleOrder.ShowAlert4(); GVNoCumplimentadas.DataSource = lstNoCumplimentadas; GVNoCumplimentadas.DataBind(); GVNoCumplimentadas.Enabled = true; btnExportToExcel.Visible = (lstNoCumplimentadas.Count > 0); break; } case "5": { lblAlertName.Text = "Stock que caera del Safety"; List <AlertProduct> lstStockMenorSafety = ControllerManager.AlertProduct.ShowAlert5(); GVStockMenorSafety.DataSource = lstStockMenorSafety; GVStockMenorSafety.DataBind(); GVStockMenorSafety.Enabled = true; btnExportToExcel.Visible = (lstStockMenorSafety.Count > 0); break; } case "6": { lblAlertName.Text = "Diferencia en Nivel de Reposición"; List <AlertReposition> lstReposicionDife = ControllerManager.AlertReposition.ShowAlert(OrderField, sortOrder); GVReposicionDiferente.DataSource = lstReposicionDife; GVReposicionDiferente.DataBind(); GVReposicionDiferente.Enabled = true; btnExportToExcel.Visible = (lstReposicionDife.Count > 0); break; } } } }