//protected void ddl2_SelectedIndexChanged(object sender, EventArgs e) //{ // fillHeaderGrid(); //} public void fillHeaderGrid() { var orderTxn = new OrderTransactions(); if (FilterOrder == Constants.FreshOrder) { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = StageType == Constants.BillTrackingType ? Constants.SaleRequestTdType : Constants.PurchaseRequestTdType, filter1 = StageType == Constants.BillTrackingType ? Constants.TRNLogedOFF + "," + Constants.TRNInProcessOFF + "," + Constants.TRNCompletedOFF : Constants.TRNLogedOFF, filter2 = CategoryType, filter3 = ForecastingGridViewListControl.Ddl1.SelectedValue.Trim(), filter4 = string.IsNullOrEmpty(ForecastingGridViewListControl.Text1Value) ? Constants.RetriveList : string.Format("{0}|{1}", ForecastingGridViewListControl.Text1Value, Constants.RetriveList), //filter5 = StageType == Constants.BillTrackingType ? ForecastingGridViewListControl.Ddl2.SelectedValue.Trim() : string.Empty, FilterKey = Constants.TableFolloup }; orderTxn = _transactionManager.GetFollowupData(queryArgument); } else { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { filter2 = CategoryType, filter3 = ForecastingGridViewListControl.Ddl1.SelectedValue.Trim(), filter4 = string.IsNullOrEmpty(ForecastingGridViewListControl.Text1Value) ? Constants.RetriveList : string.Format("{0}|{1}", ForecastingGridViewListControl.Text1Value, Constants.RetriveList), FilterKey = Constants.FlolloupPendingFollowup }; orderTxn = _transactionManager.GetpPendingFollowupData(queryArgument); } KeyValuePairItems headers = new KeyValuePairItems(); headers.Add(new KeyValuePairItem("1", Constants.ForcastingHeader)); if (StageType == Constants.BillTrackingType) { headers.Add(new KeyValuePairItem("2", Constants.SRHeader)); if (FilterOrder == Constants.PendingOrder) { headers.Add(new KeyValuePairItem("5", Constants.StatusHeader)); } else { headers.Add(new KeyValuePairItem("5", Constants.ReqLocHeader)); } } else { headers.Add(new KeyValuePairItem("2", Constants.FRHeader)); } ForecastingGridViewListControl.GVHeaders = headers; ForecastingGridViewListControl.IsVisiableColumn(2, true); ForecastingGridViewListControl.OrderTxns = orderTxn; uplForm.Update(); }
private void BindGridViewListData(OrderTransactions orderTxns) { GVListData.DataSource = orderTxns.ToList(); if (_newPageIndex >= 0) { GVListData.PageIndex = _newPageIndex; } GVListData.DataSource = orderTxns.ToList(); GVListData.DataBind(); }
public void fillForm() { var partNumber = ForecastingGridViewListControl.OrderNumber; var FcDtlNo = ForecastingGridViewListControl.Amdno; var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = StageType == Constants.BillTrackingType && FilterOrder == Constants.PendingOrder ? FcDtlNo : partNumber, filter1 = StageType == Constants.BillTrackingType ? Constants.TRNLogedOFF + "," + Constants.TRNInProcessOFF + "," + Constants.TRNCompletedOFF : Constants.TRNLogedOFF, filter2 = CategoryType, filter3 = ForecastingGridViewListControl.Ddl1.SelectedValue.Trim(), filter4 = Constants.RetriveForm, FilterKey = StageType == Constants.BillTrackingType && FilterOrder == Constants.PendingOrder ? Constants.FlolloupPendingFollowup : Constants.TableFolloup }; var orderTxn = new OrderTransactions(); if (StageType == Constants.BillTrackingType && FilterOrder == Constants.PendingOrder) { orderTxn = _transactionManager.GetpPendingFollowupData(queryArgument); } else { orderTxn = _transactionManager.GetFollowupData(queryArgument); } var firstOrDefault = orderTxn.FirstOrDefault(); if (firstOrDefault == null) { fillHeaderGrid(); DiVSave = false; ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); return; } OrderTransactionsData = orderTxn; ForecastingHead.clearData(); ForecastingHead.SubIdLabel = StageType == Constants.BillTrackingType ? Constants.SRHeader : Constants.FRHeader; ForecastingHead.IsEnableSubId = false; ForecastingHead.IdLabel = Constants.ForcastingHeader; ForecastingHead.IsVisiableSubId = true; ForecastingHead.SetData(firstOrDefault.orderHead); ForecastingHead.IsEnableLocation = false; ForecastingPart.clearForm(); ForecastingPart.InputDivFalse = false; ForecastingPart.StatusOrderNoDivTrue = true; ForecastingPart.changeActionName = Constants.UpdateAction; ForecastingPart.IsVisiableCell(10, true); ForecastingPart.GVPartData = firstOrDefault.orderDetails; Action = Constants.InsertAction; ForecastingEditPart.clearForm(); uplView.Update(); DiVSave = true; }
public bool SetTeam(OrderTransactions orderTransactions) { bool result; try { result = TransactionWriteHelper.SetTeams(orderTransactions); } catch (Exception ex) { EventLogger.LogEvent(SysEventType.ERROR.ToString(), "Error", "setForecasting failed with exception", ex); throw; } return(result); }
public OrderTransactions GetBilledPartData(QueryArgument queryArgument) { var orderViewData = new OrderTransactions(); try { ReportReadHelper.QueryArgument = queryArgument; orderViewData = ReportReadHelper.GetBilledPartData(); } catch (Exception ex) { EventLogger.LogEvent(SysEventType.ERROR.ToString(), "Error", "GetBilledPartData failed with exception", ex); throw; } return(orderViewData); }
public void BindData(BindType bindType) { var queryArgument = new QueryArgument(UserContext.DataBaseInfo) { Key = Constants.PurchaseRequestTdType, filter1 = Dates.FormatDate(FromDate, Constants.Format05), filter2 = Dates.FormatDate(ToDate, Constants.Format05), filter3 = UserContext.UserProfile.Branch, filter4 = Constants.RetriveForm, FilterKey = Constants.TableOrderDetail }; var ordView = _reportManager.GetForecatingViewData(queryArgument); ForecastingGridViewListControlId.IsVisiableColumn(6, true); ForecastingGridViewListControlId.IsVisiableColumn(7, true); ForecastingGridViewListControlId.IsVisiableColumn(8, true); ForecastingGridViewListControlId.IsVisiableColumn(9, true); ForecastingGridViewListControlId.IsVisiableColumn(10, true); ForecastingGridViewListControlId.IsVisiableColumn(11, true); ForecastingGridViewListControlId.IsVisiableColumn(12, true); ForecastingGridViewListControlId.IsVisiableColumn(13, true); ForecastingGridViewListControlId.IsVisiableColumn(14, true); ForecastingGridViewListControlId.IsVisiableColumn(18, false); if (BindType.Export == bindType) { OrderTxns = ordView; } else { ForecastingGridViewListControlId.OrderTxns = ordView; } //var queryArgument = new QueryArgument(UserContext.DataBaseInfo) //{ // Key = Constants.PurchaseRequestTdType, // filter1 = Dates.FormatDate(FromDate, Constants.Format05), // filter2 = Dates.FormatDate(ToDate, Constants.Format05), // filter3 = UserContext.UserProfile.Branch, // filter4 = Constants.RetriveList, // FilterKey = Constants.TableOrderDetail //}; //var ordView = _reportManager.GetForecatingViewData(queryArgument); //ForecastingGridViewListControlId.changeActionName = Constants.ViewAction; //ForecastingGridViewListControlId.OrderTxns = ordView; uplForm.Update(); }
protected void lnkSave_Click(object sender, EventArgs e) { OrderTransactions orderTransactions = new OrderTransactions(); orderTransactions.Add(new OrderTransaction { OrderType = Constants.PurchaseRequestTdType, orderHead = ForecastingHead.GetData(), orderDetails = ForecastingPart.GVPartData, updateOrderDeatils = ForecastingPart.OrderDetailData, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, StageId = TransactionStageControlId.ActiveStage.Trim(), Bu = UserContext.UserProfile.Bu, Off = Constants.TRNInProcessOFF, Branch = UserContext.UserProfile.Branch, LogedUser = UserContext.UserId, }); var firstOrDefault = orderTransactions.FirstOrDefault(); var references = getReferences(); if (firstOrDefault != null) { firstOrDefault.References = references; } if (_transactionManager.SetForcasting(orderTransactions)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.ForecastingSave; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Forecasting Saved", GlobalCustomResource.ForecastingSave, true); fillHeaderGrid(); DivAction = false; ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.ForecastingFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Forecasting Update Failed", GlobalCustomResource.ForecastingFailed, true); } }
public async Task <OrderTransactionsDto> Handle(Command request, CancellationToken cancellationToken) { var orderTransactions = new OrderTransactions { TimeStamp = request.TimeStamp, Action = request.Action, Comment = request.Comment, Attachments = request.Attachments }; _context.OrderTransactionss.Add(orderTransactions); var success = await _context.SaveChangesAsync() > 0; if (success) { var toReturn = _mapper.Map <OrderTransactions, OrderTransactionsDto>(orderTransactions); return(toReturn); } throw new Exception("Problem saving changes"); }
protected void Approve(object sender, EventArgs e) { var orderTransactions = new OrderTransactions(); var orderDeatils = new OrderDetails(); orderDeatils.Add(new OrderDetail { SlNo = ForecastingGridViewListControl.Amdno.Trim() }); orderTransactions.Add(new OrderTransaction { orderHead = new OrderHead { OrderNumber = ForecastingGridViewListControl.OrderNumber.Trim(), }, orderDetails = orderDeatils, Action = Constants.UpdateAction, DataBaseInfo = UserContext.DataBaseInfo, Off = Constants.TRNCompletedOFF, }); if (_transactionManager.SetFollowupApprove(orderTransactions)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.ApprovedSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Approved Data Saved", GlobalCustomResource.ApprovedSaved, true); fillHeaderGrid(); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.ApprovedFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Approved Data Update Failed", GlobalCustomResource.ApprovedFailed, true); } }
protected void Save_Click(object sender, EventArgs e) { OrderTransactions orderTransactions = new OrderTransactions(); var orderDetails = OrderTransactionsData.FirstOrDefault().orderDetails.Where(x => x.SlNo.Trim() == SlNoKey).ToList(); var orderDetails1 = OrderTransactionsData.FirstOrDefault().orderDetails.Where(x => x.SlNo.Trim() == SlNoKey).ToList(); if (orderDetails.Count == 0) { return; } var updateOrderDetails = new OrderDetails(); foreach (var orderdetail in orderDetails) { //orderdetail.LogisticOrderNumber = ForecastingEditPart.LogistiOrderNumber.Trim(); orderdetail.SQuantity += ForecastingEditPart.Quantity; if (StageType == Constants.BillTrackingType) { if (FilterOrder == Constants.PendingOrder && ForecastingEditPart.Quantity == ForecastingEditPart.RemaingQty) { orderdetail.Off = Constants.TRNCompletedOFF; } else { orderdetail.Off = Constants.TRNInProcessOFF; } } else { if (ForecastingEditPart.Quantity == ForecastingEditPart.RemaingQty) { orderdetail.Off = Constants.TRNInProcessOFF; } else { orderdetail.Off = Constants.TRNLogedOFF; } } if (ForecastingEditPart.CurrentStatus == Constants.OrderingType || ForecastingEditPart.CurrentStatus == Constants.ChangeStatus || ForecastingEditPart.CurrentStatus == Constants.AlternativePartNeeded) { orderdetail.ShQuantity += ForecastingEditPart.Quantity; if (ForecastingEditPart.CurrentStatus == Constants.ChangeStatus) { orderdetail.BQuantity += ForecastingEditPart.Quantity; orderdetail.DoQuantity += ForecastingEditPart.Quantity; } orderdetail.LogisticOrderNumber = orderdetail.LogisticOrderNumber.Trim() + "," + ForecastingEditPart.LogistiOrderNumber.Trim(); } updateOrderDetails.Add(orderdetail); } var insertOrderDeatil = new OrderDetails(); foreach (var orderdetail in orderDetails1) { orderdetail.SQuantity = ForecastingEditPart.CurrentStatus == Constants.AlternativePartNeeded ? ForecastingEditPart.Quantity : 0; orderdetail.Quantity = ForecastingEditPart.Quantity; orderdetail.CurrentStatus = ForecastingEditPart.CurrentStatus; orderdetail.LogisticOrderNumber = ForecastingEditPart.LogistiOrderNumber.Trim(); insertOrderDeatil.Add(orderdetail); } var sqty = orderDetails.FirstOrDefault().Quantity; var qty = ForecastingEditPart.Quantity; orderTransactions.Add(new OrderTransaction { orderHead = ForecastingHead.GetData(), orderDetails = insertOrderDeatil, updateOrderDeatils = updateOrderDetails, Action = Action, DataBaseInfo = UserContext.DataBaseInfo, StageId = TransactionStageControlId.ActiveStage.Trim(), Bu = UserContext.UserProfile.Bu, Off = StageType == Constants.BillTrackingType ? ForecastingEditPart.CurrentStatus == Constants.OrderingType ? Constants.TRNCompletedOFF : Constants.TRNInProcessOFF : qty == ForecastingEditPart.RemaingQty ? Constants.TRNInProcessOFF : Constants.TRNLogedOFF, //Off = Constants.TRNInProcessOFF, Branch = UserContext.UserProfile.Branch, LogedUser = UserContext.UserId, FormType = FilterOrder == Constants.PendingOrder ? FormType.Pending : FormType.Fresh }); var firstOrDefault = orderTransactions.FirstOrDefault(); var references = getReferences(); if (firstOrDefault != null) { firstOrDefault.References = references; } if (_transactionManager.SetTeam(orderTransactions)) { CustomMessageControl.MessageBodyText = GlobalCustomResource.TeamDataSaved; CustomMessageControl.MessageType = MessageTypes.Success; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Team Data Saved", GlobalCustomResource.TeamDataSaved, true); ForecastingEditPart.clearForm(); // divEdit.Visible = false; divEdit.Attributes.Add("style", "display:none"); ClearReferences(); fillForm(); // ScriptManager.RegisterStartupScript(Page, typeof(Page), "openTabFunctionCall", "openTab(1)", true); } else { CustomMessageControl.MessageBodyText = GlobalCustomResource.TeamDataFailed; CustomMessageControl.MessageType = MessageTypes.Error; CustomMessageControl.ShowMessage(); AuditLog.LogEvent(UserContext, SysEventType.INFO, "Team Data Update Failed", GlobalCustomResource.TeamDataFailed, true); } }