private void Display() { lblRetrievalNo.Text = manageStationeryRetrievalListControl.RetrievalId; retrievalList = manageStationeryRetrievalListControl.RetrievalList; int index = 0; int group = 0; int fulfillPage = SystemStoreInventorySystemUtil.Converter.objToInt(StationeryStoreInventorySystemController.Util.GetSession(fulfillPageSessionKey)); int startingShowIndex = fulfillPage > 1 ? fulfillPage * ManageStationeryRetrievalListControl.totalRetrievalToSet : 0; foreach (string key in retrievalList.Keys) { if (index++ >= startingShowIndex && group < ManageStationeryRetrievalListControl.totalRetrievalToSet) { WebGroupBox webGroupBox = (WebGroupBox)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + (++group)); if (webGroupBox != null) { Label lblBin = (Label)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + group + "$lblFulfillBin" + group); Label lblNeededQty = (Label)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + group + "$lblFulfillNeededQty" + group); Label lblActualQty = (Label)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + group + "$lblFulfillActualQty" + group); WebDataGrid webDataGrid = (WebDataGrid)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + group + "$FulfillWebDataGrid" + group); if (lblBin != null && lblNeededQty != null && lblActualQty != null && webDataGrid != null) { webGroupBox.Visible = true; webDataGrid.Visible = true; DataTable dt = (DataTable)retrievalList[key][COLUMN_TABLE]; webGroupBox.Text = retrievalList[key][COLUMN_DESCRIPTION].ToString(); lblBin.Text = retrievalList[key][COLUMN_BIN].ToString(); lblNeededQty.Text = retrievalList[key][COLUMN_NEEDED_QTY].ToString(); lblActualQty.Text = retrievalList[key][COLUMN_ACTUAL_QTY].ToString(); webDataGrid.DataSource = dt; webDataGrid.DataBind(); } } } } if (retrievalList.Count() > ManageStationeryRetrievalListControl.totalRetrievalToSet) { HyperLink fulfilledLink; for (int i = 0; i < SystemStoreInventorySystemUtil.Converter.objToInt(Math.Ceiling((double)(retrievalList.Count() / ManageStationeryRetrievalListControl.totalRetrievalToSet))); i++) { fulfilledLink = new HyperLink(); fulfilledLink.Attributes["style"] = "padding-left: 5px;"; if (i != fulfillPage - 1) { fulfilledLink.NavigateUrl = "~/storeUI/Clerk/ManageStationeryRetrievalList.aspx?fulfilledpage=" + (i + 1); } fulfilledLink.Text = (i + 1).ToString(); FulfilledPaginating.Controls.Add(fulfilledLink); } } if (retrievalList.Count() == 0) { fulfilledPanel.Visible = false; } index = 0; group = 0; int unfulfillPage = SystemStoreInventorySystemUtil.Converter.objToInt(StationeryStoreInventorySystemController.Util.GetSession(unfulfillPageSessionKey)); startingShowIndex = unfulfillPage > 1 ? unfulfillPage * ManageStationeryRetrievalListControl.totalRetrievalToSet : 0; unfulfilledRetrievalList = manageStationeryRetrievalListControl.UnfulfilledRetrievalList; foreach (string key in unfulfilledRetrievalList.Keys) { if (index++ >= startingShowIndex && group < ManageStationeryRetrievalListControl.totalRetrievalToSet) { WebGroupBox webGroupBox = (WebGroupBox)this.FindControl("ctl00$MainContent$WebGroupBox" + (++group)); if (webGroupBox != null) { Label lblBin = (Label)this.FindControl("ctl00$MainContent$WebGroupBox" + group + "$lblBin" + group); Label lblNeededQty = (Label)this.FindControl("ctl00$MainContent$WebGroupBox" + group + "$lblNeededQty" + group); Label lblActualQty = (Label)this.FindControl("ctl00$MainContent$WebGroupBox" + group + "$lblActualQty" + group); WebDataGrid webDataGrid = (WebDataGrid)this.FindControl("ctl00$MainContent$WebGroupBox" + group + "$DgvManageStationeryRetrievalList" + group); if (lblBin != null && lblNeededQty != null && lblActualQty != null && webDataGrid != null) { webGroupBox.Visible = true; webDataGrid.Visible = true; DataTable dt = (DataTable)unfulfilledRetrievalList[key][COLUMN_TABLE]; webGroupBox.Text = unfulfilledRetrievalList[key][COLUMN_DESCRIPTION].ToString(); lblBin.Text = unfulfilledRetrievalList[key][COLUMN_BIN].ToString(); lblNeededQty.Text = unfulfilledRetrievalList[key][COLUMN_NEEDED_QTY].ToString(); lblActualQty.Text = unfulfilledRetrievalList[key][COLUMN_ACTUAL_QTY].ToString(); webDataGrid.DataSource = dt; webDataGrid.DataBind(); } } } } if (unfulfilledRetrievalList.Count() > ManageStationeryRetrievalListControl.totalRetrievalToSet) { HyperLink unfulfilledLink; for (int i = 0; i < SystemStoreInventorySystemUtil.Converter.objToInt(Math.Ceiling((double)(unfulfilledRetrievalList.Count() / ManageStationeryRetrievalListControl.totalRetrievalToSet))); i++) { unfulfilledLink = new HyperLink(); unfulfilledLink.Attributes["style"] = "padding-left: 5px;"; if (i != unfulfillPage - 1) { unfulfilledLink.NavigateUrl = "~/storeUI/Clerk/ManageStationeryRetrievalList.aspx?unfulfilledpage=" + (i + 1); } unfulfilledLink.Text = (i + 1).ToString(); UnfulfilledPaginating.Controls.Add(unfulfilledLink); } } if (unfulfilledRetrievalList.Count() == 0) { unfulfilledPanel.Visible = false; } }
protected void btnSubmit_Click(object sender, EventArgs e) { retrievalList = manageStationeryRetrievalListControl.RetrievalList; unfulfilledRetrievalList = manageStationeryRetrievalListControl.UnfulfilledRetrievalList; int index = 0; int group = 0; int fulfillPage = SystemStoreInventorySystemUtil.Converter.objToInt(StationeryStoreInventorySystemController.Util.GetSession(fulfillPageSessionKey)); int startingShowIndex = fulfillPage > 1 ? fulfillPage * ManageStationeryRetrievalListControl.totalRetrievalToSet : 0; foreach (string key in retrievalList.Keys) { if (index++ >= startingShowIndex && group < ManageStationeryRetrievalListControl.totalRetrievalToSet) { WebGroupBox webGroupBox = (WebGroupBox)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + (++group)); if (webGroupBox != null) { WebDataGrid webDataGrid = (WebDataGrid)this.FindControl("ctl00$MainContent$FulfillWebGroupBox" + group + "$FulfillWebDataGrid" + group); DataTable dt = (DataTable)retrievalList[key][COLUMN_TABLE]; for (int i = 0; i < webDataGrid.Rows.Count; i++) { if (SystemStoreInventorySystemUtil.Converter.objToInt(((Infragistics.Web.UI.EditorControls.WebTextEditor)webDataGrid.Rows[i].Items.FindItemByKey("ActualQty").FindControl("ActualQty")).Text) <= SystemStoreInventorySystemUtil.Converter.objToInt(dt.Rows[i][1])) { dt.Rows[i][2] = ((Infragistics.Web.UI.EditorControls.WebTextEditor)webDataGrid.Rows[i].Items.FindItemByKey("ActualQty").FindControl("ActualQty")).Text; } else { dt.Rows[i][2] = dt.Rows[i][1]; } } } } } index = 0; group = 0; int unfulfillPage = SystemStoreInventorySystemUtil.Converter.objToInt(StationeryStoreInventorySystemController.Util.GetSession(unfulfillPageSessionKey)); startingShowIndex = unfulfillPage > 1 ? unfulfillPage * ManageStationeryRetrievalListControl.totalRetrievalToSet : 0; foreach (string key in unfulfilledRetrievalList.Keys) { if (index++ >= startingShowIndex && group < ManageStationeryRetrievalListControl.totalRetrievalToSet) { WebGroupBox webGroupBox = (WebGroupBox)this.FindControl("ctl00$MainContent$WebGroupBox" + (++group)); if (webGroupBox != null) { WebDataGrid webDataGrid = (WebDataGrid)this.FindControl("ctl00$MainContent$WebGroupBox" + group + "$DgvManageStationeryRetrievalList" + group); //manageStationeryRetrievalListControl.SelectSave(((WebGroupBox)this.FindControl("ctl00$MainContent$WebGroupBox" + group)).Text, (DataTable)webDataGrid.DataSource); DataTable dt = (DataTable)unfulfilledRetrievalList[key][COLUMN_TABLE]; for (int i = 0; i < webDataGrid.Rows.Count; i++) { dt.Rows[i][2] = ((Infragistics.Web.UI.EditorControls.WebTextEditor)webDataGrid.Rows[i].Items.FindItemByKey("ActualQty").FindControl("ActualQty")).Text; } } } } manageStationeryRetrievalListControl.SelectSave(); }