private void Manp_ItemPriceByItem_Shown(object sender, EventArgs e) { spPurchasePrice.Visible = StaticData.IsPermitted(16); spSalePrice.Visible = StaticData.IsPermitted(17); gcCards.Visible = StaticData.IsPermitted(18); btnOk.Visible = StaticData.IsPermitted(19); List <CardView> cards = OperationHandler.GetCards().Value.Where(x => x.CardTypeId == 1 || x.CardTypeId == 2).ToList(); List <ItemPrice> ItemPrices = OperationHandler.GetItemPrices(item.Id).Value; List <ItemPriceView> priceView = new List <ItemPriceView>(); foreach (CardView card in cards) { ItemPriceView price = new ItemPriceView(); price.CardId = card.Id; price.CardName = card.CardName; price.CardNumber = card.CardNumber; ItemPrice priceForCard = ItemPrices.Where(x => x.CardId == card.Id).FirstOrDefault(); if (priceForCard != null) { price.IsSpecial = true; price.Price = priceForCard.Price; } priceView.Add(price); } gcCards.DataSource = priceView; txtItemCode.Text = item.ItemCode; txtItemName.Text = item.ItemName; txtItemType.Text = item.ItemTypeName; spPurchasePrice.Value = item.DefaultPurchasePrice; spSalePrice.Value = item.DefaultSalePrice; }
private void RefreshData() { Operation <List <CardView> > op_CardMaster = OperationHandler.GetCards(); if (op_CardMaster.Successful) { gcData.DataSource = op_CardMaster.Value; } else { // Show Error } }
private void Manp_DataPermissions_Shown(object sender, EventArgs e) { var op_CardMaster = OperationHandler.GetCards(); if (op_CardMaster.Successful) { AllCards = op_CardMaster.Value.Where(x => x.ByPermission).ToList(); searchLookUpCard.Properties.DataSource = AllCards; } User user = OperationHandler.GetUserById(UserId).Value; txtUserName.Text = user.UserName; refreshLines(); }
public IBaseOperation LoadMasterData() { List <IBaseOperation> loadOperations = new List <IBaseOperation>(); //Operation<List<EnumMaster>> op_ItemTypes = OperationHandler.GetEnums(3); //loadOperations.Add(op_ItemTypes); Operation <List <ItemView> > op_Items = OperationHandler.GetItems(); loadOperations.Add(op_Items); //Operation<List<ExchangeMaster>> op_ExchangeMaster = OperationHandler.GetAllExchanges(); //loadOperations.Add(op_ExchangeMaster); Operation <List <CardView> > op_CardMaster = OperationHandler.GetCards(); loadOperations.Add(op_CardMaster); Operation <List <Warehouse> > op_Warehouses = OperationHandler.GetWarehouses(); loadOperations.Add(op_Warehouses); //Operation<List<WarehouseMaster>> op_Warehouses = OperationHandler.GetWarehouses(); //loadOperations.Add(op_Warehouses); //Operation<List<ItemPrice>> op_ItemPrices = OperationHandler.GetItemPricesList(); //loadOperations.Add(op_ItemPrices); //Operation<List<DocumentMaster>> op_DocumentMasters = OperationHandler.GetDocumentMasters(); //loadOperations.Add(op_DocumentMasters); //foreach (IBaseOperation ibop in loadOperations) //{ // if (!ibop.Successful) // { // return ibop; // } //} Items = op_Items.Value; Cards = op_CardMaster.Value; Warehouses = op_Warehouses.Value; //ItemPrices = op_ItemPrices.Value; //DocumentMasters = op_DocumentMasters.Value; //PriceCalcTypes = op_PriceCalcTypes.Value; return(new BaseOperation { Successful = true }); }