Example #1
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            var list = OperationHandler.GetCardTotalsByInterval(StaticData.CurrentUserId, dateBegin.DateTime, dateEnd.DateTime).Value;

            //foreach (var accItem in list)
            //{
            //    if (accItem.RemByBegDate > 0)
            //    {
            //        accItem.RemDebitByBegDate = accItem.RemByBegDate;
            //    }
            //    else
            //    {
            //        accItem.RemCreditByBegDate = Math.Abs(accItem.RemByBegDate);
            //    }
            //    if (accItem.RemByEndDate > 0)
            //    {
            //        accItem.RemDebitByEndDate = accItem.RemByEndDate;
            //    }
            //    else
            //    {
            //        accItem.RemCreditByEndDate = Math.Abs(accItem.RemByEndDate);
            //    }
            //}
            gcData.DataSource = list;
        }
Example #2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            refreshLineTotals();

            Fiche = bindTool.DataObject;
            if (isNew)
            {
                Fiche.CreatedBy   = StaticData.CurrentUserId;
                Fiche.CreatedDate = DateTime.Now;
            }
            Fiche.DocTypeId = DocumentType.Id;

            if (CreateInvoiceFromOrderFiche)
            {
                Fiche.DocTypeId   = DocumentType.Id = 2;
                Fiche.CreatedDate = DateTime.Now;
                Fiche.CreatedBy   = StaticData.CurrentUserId;
                Fiche.Id          = 0;
            }
            Operation <FicheMasterView> postedFiche = OperationHandler.PostFiche(Fiche);

            if (postedFiche.Successful)
            {
                Close();
            }
            SetError(postedFiche.Fail, false);
        }
Example #3
0
        private void Manp_Users_Shown(object sender, EventArgs e)
        {
            User user = new User();

            objectBindTool.BindControl(txtLogin, nameof(user.Login));
            objectBindTool.BindControl(txtUserName, nameof(user.UserName));
            objectBindTool.BindControl(chkIsActive, nameof(user.IsActive));
            objectBindTool.BindControl(chkIsAdmin, nameof(user.IsAdmin));
            if (Id != 0)
            {
                user = OperationHandler.GetUserById(Id).Value;
            }
            if (user == null)
            {
                OnLoadError(null);
            }
            if (user.Id == 0)
            {
            }
            else
            {
                txtLogin.ReadOnly = true;
            }
            objectBindTool.DataObject = user;
        }
Example #4
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (Id == 0)
            {
                card.CreatedDate = DateTime.Now;
                card.CreatedBy   = StaticData.CurrentUserId;
            }
            card = bindTool.DataObject;
            //card.CardTypeId = Convert.ToByte(lookUpCardType.EditValue);
            //card.CardNumber = txtCardCode.Text;
            //card.CardName = txtCardName.Text;
            //card.CurrencyId = Convert.ToByte(lookUpCurrency.EditValue);
            //card.Phone1 = txtTel1.Text;
            //card.Phone2 = txtTel2.Text;
            //card.Phone3 = txtTel3.Text;
            //card.TaxCode = txtTaxCode.Text;
            //card.Country = txtCountry.Text;
            //card.City = txtCity.Text;
            //card.Town = txtTown.Text;
            //card.District = txtDistrict.Text;
            //card.LocationAddress = txtLocationAddress.Text;
            //card.DebtLimit = spDebtLimit.Value;
            //card.IsActive = chkActive.Checked;
            Operation <Card> operation = OperationHandler.PostCard(card);

            if (operation.Successful)
            {
                this.Close();
            }
            lblError.Text = operation.Fail;
        }
Example #5
0
        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;
        }
Example #6
0
        private void Form_CardHistory_Shown(object sender, EventArgs e)
        {
            gvData.AssignGridView(19);
            var cardData = OperationHandler.GetCardMaster(CardId).Value;

            this.Text = cardData.CardName;
            RefreshData();
        }
Example #7
0
        void RefreshData()
        {
            var dataOper = OperationHandler.GetCardTransactionViewByCardId(CardId, dateBegin.DateTime, dateEnd.DateTime);

            if (dataOper.Successful)
            {
                gcData.DataSource = dataOper.Value;
            }
        }
Example #8
0
 private void Manp_WarehouseProcess_Shown(object sender, EventArgs e)
 {
     if (Id != 0)
     {
         btnOk.Enabled = false;
     }
     Fiches = OperationHandler.GetFichesByProcessId(Id).Value;
     gcFichesOfProc.DataSource = Fiches;
 }
Example #9
0
        void RefreshData()
        {
            if (lookUpFicheType.EditValue == null)
            {
                return;
            }
            Operation <List <FicheMasterView> > op_Fiches = OperationHandler.GetFiches(Convert.ToByte(lookUpFicheType.EditValue), dateBegin.DateTime, dateEnd.DateTime);

            gcData.DataSource = op_Fiches.Value;
        }
Example #10
0
 private void Manp_WarehouseProcessDetail_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F2)
     {
         if (gvLines.GetFocusedRow() is WarehouseProcessDetailView detailView)
         {
             OperationHandler.CompleteWarehouseProcessDetail(detailView.Id);
             RefreshData();
         }
     }
 }
Example #11
0
        private void Manp_UserPermissions_Shown(object sender, EventArgs e)
        {
            Operation <List <PermissionMasterView> > op_PermissionMasters = OperationHandler.GetUserPermissions(UserId);

            if (!op_PermissionMasters.Successful)
            {
                OnLoadError(op_PermissionMasters.Fail);
                return;
            }
            Permissions = op_PermissionMasters.Value;
            treeListPermissions.DataSource = Permissions;
        }
Example #12
0
        private void tsEndProcess_Click(object sender, EventArgs e)
        {
            object objValue = gvData.GetFocusedRowCellValue("Id");

            if (objValue == null)
            {
                return;
            }
            var operation = OperationHandler.WarehouseProcessEnd(Convert.ToInt32(objValue));

            RefreshData();
        }
Example #13
0
        private void RefreshData()
        {
            Operation <List <CardView> > op_CardMaster = OperationHandler.GetCards();

            if (op_CardMaster.Successful)
            {
                gcData.DataSource = op_CardMaster.Value;
            }
            else
            {
                // Show Error
            }
        }
Example #14
0
        private void RefreshData()
        {
            Operation <List <User> > operation = OperationHandler.GetUsers();

            if (operation.Successful)
            {
                gcData.DataSource = operation.Value;
            }
            else
            {
                // Show Error
            }
        }
Example #15
0
        private void RefreshItemPriceData()
        {
            Operation <List <ItemView> > op_itprs_def = OperationHandler.GetItems();

            if (op_itprs_def.Successful)
            {
                gcByItems.DataSource = op_itprs_def.Value;
            }
            else
            {
                // Show Error
            }
        }
Example #16
0
        private void Form_Fiches_Shown(object sender, EventArgs e)
        {
            Operation <List <DocumentMaster> > op_DocumentMasters = OperationHandler.GetDocumentMasters();

            if (op_DocumentMasters.Successful)
            {
                lookUpFicheType.Properties.DataSource = op_DocumentMasters.Value.Where(x => x.Category1).ToList();
                if (op_DocumentMasters.Value.Count > 0)
                {
                    lookUpFicheType.ItemIndex = 0;
                }
            }
        }
Example #17
0
        private void RefreshData()
        {
            Operation <List <WarehouseProcessView> > op_Items = OperationHandler.GetWarehouseProcesses(dateBegin.DateTime, dateEnd.DateTime);

            if (op_Items.Successful)
            {
                gcData.DataSource = op_Items.Value;
            }
            else
            {
                // Show Error
            }
        }
Example #18
0
        private void RefreshData()
        {
            Operation <List <ItemView> > op_Items = OperationHandler.GetItems();

            if (op_Items.Successful)
            {
                gcData.DataSource = op_Items.Value;
            }
            else
            {
                // Show Error
            }
        }
Example #19
0
        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();
        }
Example #20
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            currencyByDate = bindTool.DataObject;
            var postOperation = OperationHandler.PostCurrencyByDate(currencyByDate);

            if (postOperation.Successful)
            {
                this.Close();
            }
            else
            {
                XtraMessageBox.Show(postOperation.Fail);
            }
        }
Example #21
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            User             user      = objectBindTool.DataObject;
            Operation <User> operation = OperationHandler.PostUser(user);

            if (operation.Successful)
            {
                this.Close();
            }
            else
            {
                XtraMessageBox.Show(operation.Fail);
            }
        }
Example #22
0
 public static void RetrieveAppSettings()
 {
     try
     {
         BaseSettings = OperationHandler.GetParameters().Value;
         if (BaseSettings == null)
         {
             return;
         }
         AppSettings.CompanyName = BaseSettings.Where(x => x.ParameterKey == "C19F97").First().ParameterValue;
         AppSettings.DBVersion   = Convert.ToInt32(BaseSettings.Where(x => x.ParameterKey == "CB4EAA").First().ParameterValue);
         //AppSettings.FichesManpServiceLinesClearCheckedRowsOnAddLine = Convert.ToBoolean(BaseSettings.Where(x => x.ParameterKey == "Fiches.Manp.ServiceLines.ClearCheckedRowsOnAddLine").First().ParameterValue);
     }
     catch { }
 }
Example #23
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Item = bindTool.DataObject;
            if (Id == 0)
            {
                Item.CreatedDate = DateTime.Now;
                Item.CreatedBy   = StaticData.CurrentUserId;
            }
            Operation <Item> operation = OperationHandler.PostItem(Item);

            if (operation.Successful)
            {
                this.Close();
            }
            lblError.Text = operation.Fail;
        }
Example #24
0
        public IBaseOperation LoadEnumData()
        {
            List <IBaseOperation> loadOperations = new List <IBaseOperation>();

            Operation <List <LineCalcType> > op_LineCalcType = OperationHandler.GetLineCalcTypes();

            loadOperations.Add(op_LineCalcType);
            Operation <List <ItemType> > op_ItemTypes = OperationHandler.GetItemTypes();

            loadOperations.Add(op_ItemTypes);
            Operation <List <CardType> > op_CardTypes = OperationHandler.GetCardTypes();

            loadOperations.Add(op_CardTypes);
            Operation <List <Currency> > op_Currencies = OperationHandler.GetCurrencies();

            loadOperations.Add(op_Currencies);
            Operation <List <CashType> > op_CashTypes = OperationHandler.GetCashTypes();

            loadOperations.Add(op_CashTypes);
            Operation <List <DocumentStatusType> > op_DocumentStatusTypes = OperationHandler.GetDocumentStatusTypes();

            loadOperations.Add(op_DocumentStatusTypes);
            Operation <List <DocumentMaster> > op_DocumentMasters = OperationHandler.GetDocumentMasters();

            loadOperations.Add(op_DocumentMasters);

            foreach (IBaseOperation ibop in loadOperations)
            {
                if (!ibop.Successful)
                {
                    return(ibop);
                }
            }


            LineCalcTypes       = op_LineCalcType.Value;
            ItemTypes           = op_ItemTypes.Value;
            CardTypes           = op_CardTypes.Value;
            Currencies          = op_Currencies.Value;
            CashTypes           = op_CashTypes.Value;
            DocumentStatusTypes = op_DocumentStatusTypes.Value;
            DocumentTypes       = op_DocumentMasters.Value;
            return(new BaseOperation {
                Successful = true
            });
        }
Example #25
0
        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
            });
        }
Example #26
0
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            var v = OperationHandler.PostTest().Value;

            //List<Item> lst = new List<LecERP.Item>();
            //lst.Add(new Item { ItemCode = "CODE1", ItemName = "NAME1" });
            //lst.Add(new Item { ItemCode = "CODE2", ItemName = "NAME2" });
            //gcData.DataSource = lst;
            //TestClass test = new TestClass();
            //test.Name = "Eldar";
            //ServiceWorker<TestClass> sw = new ServiceWorker<TestClass>();
            //Dictionary<string, object> prms = new Dictionary<string, object>();
            //prms["data"] = test;
            //Operation<TestClass> ope = sw.Post("PostTest2", prms);
            //Operation<List<EnumMaster>> enums = OperationHandler.GetEnums(1);
            //ServiceWorker<String> sw = new ServiceWorker<String>();
        }
Example #27
0
        private void Manp_Cards_Shown(object sender, EventArgs e)
        {
            dataHolder.LoadEnumData();
            lookUpCardType.Properties.DataSource = dataHolder.CardTypes;


            lookUpCurrency.Properties.DataSource = dataHolder.Currencies;

            if (Id == 0)
            {
                card = new Card();
                chkActive.Checked = true;
            }
            else
            {
                // GET DATA
                Operation <Card> op_card = OperationHandler.GetCardById(Id);
                if (!op_card.Successful)
                {
                    OnLoadError(op_card.Fail);
                    return;
                }
                card = op_card.Value;
                lookUpCardType.Enabled = false;
                lookUpCurrency.Enabled = false;
            }

            bindTool.BindControl(lookUpCardType, nameof(card.CardTypeId));
            bindTool.BindControl(txtCardCode, nameof(card.CardNumber));
            bindTool.BindControl(txtCardName, nameof(card.CardName));
            bindTool.BindControl(lookUpCurrency, nameof(card.CurrencyId));
            bindTool.BindControl(txtTel1, nameof(card.Phone1));
            bindTool.BindControl(txtTel2, nameof(card.Phone2));
            bindTool.BindControl(txtTel3, nameof(card.Phone3));
            bindTool.BindControl(txtTaxCode, nameof(card.TaxCode));
            bindTool.BindControl(txtCountry, nameof(card.Country));
            bindTool.BindControl(txtCity, nameof(card.City));
            bindTool.BindControl(txtTown, nameof(card.Town));
            bindTool.BindControl(txtDistrict, nameof(card.District));
            bindTool.BindControl(txtLocationAddress, nameof(card.LocationAddress));
            bindTool.BindControl(spDebtLimit, nameof(card.DebtLimit));
            bindTool.BindControl(chkActive, nameof(card.IsActive));

            bindTool.DataObject = card;
        }
Example #28
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            List <ItemPrice> list = new List <ItemPrice>();

            ItemPrice itemPrice = null;

            itemPrice             = new ItemPrice();
            itemPrice.CardId      = 0;
            itemPrice.CreatedBy   = StaticData.CurrentUserId;
            itemPrice.CreatedDate = DateTime.Now;
            itemPrice.ItemId      = item.Id;
            itemPrice.Price       = spPurchasePrice.Value;
            itemPrice.PriceTypeId = 1;
            list.Add(itemPrice);

            itemPrice             = new ItemPrice();
            itemPrice.CardId      = 0;
            itemPrice.CreatedBy   = StaticData.CurrentUserId;
            itemPrice.CreatedDate = DateTime.Now;
            itemPrice.ItemId      = item.Id;
            itemPrice.Price       = spSalePrice.Value;
            itemPrice.PriceTypeId = 2;
            list.Add(itemPrice);


            foreach (ItemPriceView itc in (gcCards.DataSource as List <ItemPriceView>).Where(x => x.IsSpecial))
            {
                itemPrice             = new ItemPrice();
                itemPrice.CardId      = itc.CardId;
                itemPrice.CreatedBy   = StaticData.CurrentUserId;
                itemPrice.CreatedDate = DateTime.Now;
                itemPrice.ItemId      = item.Id;
                itemPrice.Price       = Convert.ToDecimal(itc.Price);
                itemPrice.PriceTypeId = 2;
                list.Add(itemPrice);
            }

            Operation <string> operation = OperationHandler.PostItemPrices(item.Id, list);

            if (operation.Successful)
            {
                this.Close();
            }
            lblError.Text = operation.Fail;
        }
Example #29
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            cardFiche           = ficheBindTool.DataObject;
            creditLine          = creditLineBindTool.DataObject;
            debitLine           = debitLineBindTool.DataObject;
            creditLine.SignType = -1;
            debitLine.SignType  = 1;
            cardFiche.Lines     = new List <CardFicheLine> {
                creditLine, debitLine
            };
            Operation <CardFiche> postedCashTransaction = OperationHandler.PostCardFiche(cardFiche);

            if (postedCashTransaction.Successful)
            {
                this.Close();
            }
            SetError(postedCashTransaction.Fail, false);
        }
Example #30
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            object objId = gvLines.GetFocusedRow();

            if (objId == null)
            {
                return;
            }
            int cardViewId               = (objId as CardView).Id;
            int cardPermissionId         = cardPermissions.Where(x => x.CardId == cardViewId).FirstOrDefault().Id;
            Operation <string> operation = OperationHandler.DeleteObjectById(nameof(CardPermission), cardPermissionId);

            if (!operation.Successful)
            {
                MessageBox.Show(operation.Fail);
            }
            refreshLines();
        }