public void Put(string id, [FromBody] CounterModel counter)
        {
            Counter existingCounter = this.dbContext.Counters.FirstOrDefault(x => x.CounterId == id);

            this.mapper.Map(counter, existingCounter);
            this.dbContext.SaveChanges();
            this.hubContext.Clients.Group(counter.CounterId).updateCounter(counter);
        }
Example #2
0
        public ActionResult Index()
        {
            var query = db.tbl_Counters.FirstOrDefault();
            var model = new CounterModel()
            {
                ctr_value = query.ctr_value
            };

            return(View(model));
        }
Example #3
0
        /// <summary>
        /// Set progress bar value
        /// </summary>
        /// <returns></returns>
        /// 2019/07/13, Vinoth N,  Initial Version
        private void RunProgressbar(double currentProcess, double overAllProcess, CounterModel lines)
        {
            double progressValue = (double)(currentProcess / overAllProcess) * 100.0;

            Dispatcher.Invoke(() =>
            {
                dashboardProgress.Value = progressValue;
                counterStatus.Content   = "Extracting: " + lines.FileName + "/" + lines.FunctionName;
            });
        }
Example #4
0
        public CounterViewModel(CounterModel counterModel)
        {
            _counterModel = counterModel;

            _increaseCurrentValueCommand = new RelayCommand(obj => true, obj => IncreaseCurrentValue());
            _decreaseCurrentValueCommand = new RelayCommand(obj => true, obj => DecreaseCurrentValue());

            _acceptCommand = new RelayCommand(obj => true, obj => OnAccept());
            _rejectCommand = new RelayCommand(obj => true, obj => OnReject());
        }
        public CounterViewModel(CounterModel counterModel)
        {
            // もらったCounterModelに対する処理をやるようにしておく
            CounterName = counterModel.ObserveProperty(x => x.Name).ToReactiveProperty();
            Count       = counterModel.ObserveProperty(x => x.Count).ToReactiveProperty();

            UpCommand = new ReactiveCommand();
            UpCommand.Subscribe(counterModel.Up);

            DownCommand = new ReactiveCommand();
            DownCommand.Subscribe(counterModel.Down);
        }
Example #6
0
        private int GetNextId()
        {
            var filter = Builders <CounterModel> .Filter.Eq("Id", "userId");

            var update = Builders <CounterModel> .Update.Inc(s => s.Value, 1);

            var options = new FindOneAndUpdateOptions <CounterModel> {
                IsUpsert = true, ReturnDocument = ReturnDocument.After
            };
            CounterModel c = counters.FindOneAndUpdate(filter, update, options);

            return(c.Value);
        }
Example #7
0
        public async Task <SlimCounterViewModel> GetCounterInfoAsync(int id)
        {
            CounterModel _cm = await _counterRepository.GetAsync(id);

            if (_cm == null)
            {
                return(null);
            }

            return(new SlimCounterViewModel {
                Id = _cm.Id.ToString(), VillageName = _cm.VillageName
            });
        }
        protected override Task <ActionModelBase> GetActionInternal()
        {
            if (!ChannelSession.Settings.Counters.ContainsKey(this.CounterName))
            {
                ChannelSession.Settings.Counters[this.CounterName] = new CounterModel(this.CounterName);
            }
            CounterModel counter = ChannelSession.Settings.Counters[this.CounterName];

            counter.SaveToFile  = this.SaveToFile;
            counter.ResetOnLoad = this.ResetOnLoad;

            return(Task.FromResult <ActionModelBase>(new CounterActionModel(this.CounterName, this.SelectedActionType, this.Amount)));
        }
        //web dünyasında veri tutmak veya veri aktarmak için mümkün olduğunca static KULLANMAKTAN KAÇIN!!!!
        //bunun yerine sessionlar kullanılır.

        // GET: Counter
        public ActionResult Index()
        {
            CounterModel model = new CounterModel();
            int          sayi  = 0;

            if (Session["Sayi"] == null)
            {
                Session.Add("Sayi", sayi);
            }
            sayi            = (int)Session["Sayi"];
            model.Sayi      = sayi + 1;
            Session["Sayi"] = model.Sayi;
            return(View(model));
        }
        public CounterActionEditorControlViewModel(CounterActionModel action)
            : base(action)
        {
            this.CounterName        = action.CounterName;
            this.SelectedActionType = action.ActionType;
            this.Amount             = action.Amount;

            if (ChannelSession.Settings.Counters.ContainsKey(this.CounterName))
            {
                CounterModel counter = ChannelSession.Settings.Counters[this.CounterName];
                this.SaveToFile  = counter.SaveToFile;
                this.ResetOnLoad = counter.ResetOnLoad;
            }
        }
Example #11
0
        private List <CounterModel> GetData()
        {
            var dataBatch = new List <CounterModel>();

            for (int i = 0; i < this.saveFileIntervalSeconds; i++)
            {
                var randomByte         = this.dataProviderService.GetRandomByte();
                var randomByteAsString = this.dataProviderService.GetByteAsString(randomByte);
                this.logger.LogInformation("Random byte generated : {0}", randomByteAsString);
                var countersList = CountBits(randomByte);
                var item         = new CounterModel(randomByteAsString, countersList);
                this.logger.LogInformation("Counter model created");
                dataBatch.Add(item);
            }
            return(dataBatch);
        }
Example #12
0
        // GET: Home
        public ActionResult Index()
        {
            var state = App.CounterStore.GetState();

            if (state == 0)
            {
                var model = new CounterModel();
                App.CounterStore.Subscribe(counter => model.Text = counter.ToString());
                ViewBag.Text = model.Text;
            }
            else
            {
                ViewBag.Text = state.ToString();
            }

            return(View());
        }
Example #13
0
        public async Task Insert(CounterModel counterModel)
        {
            using (var transaction = await _context.Database.BeginTransactionAsync())
            {
                try
                {
                    _context.Counters.Add(counterModel);
                    await _context.SaveChangesAsync();

                    transaction.Commit();
                }
                catch (Exception)
                {
                    transaction.Rollback();
                    throw;
                }
            }
        }
        public async Task <IViewComponentResult> InvokeAsync()
        {
            CounterModel model = new CounterModel
            {
                Orders       = db.Orders.ToList(),
                Blogs        = db.Blogs.ToList(),
                Products     = db.Products.ToList(),
                Users        = db.Users.ToList(),
                Authors      = db.Authors.ToList(),
                Categories   = db.Categories.ToList(),
                Images       = db.BlogDescImages.ToList(),
                FollowImages = db.FollowImages.ToList(),
                Sliders      = db.Sliders.ToList(),
                Companies    = db.Companies.ToList()
            };

            return(View(await Task.FromResult(model)));
        }
Example #15
0
        private (CounterModel counter, bool success, string message) Validate(CounterModel c)
        {
            bool   success = false;
            string message;

            if (c.To <= c.From)
            {
                message = "'To' must be later than 'From'";
            }

            else
            {
                message = "Ok";
                success = true;
            }

            return(c, success, message);
        }
Example #16
0
        public ActionResult PrintBill(int tableId)
        {
            CounterModel model = new CounterModel();

            model.Invoice = entity.Invoices.SingleOrDefault(i => i.Number == tableId && !i.Status);
            model.TableId = tableId;
            var currentTable = entity.Tables.SingleOrDefault(table => table.Number == tableId);

            if (currentTable != null && currentTable.Status)
            {
                var currentInvoice = entity.Invoices.SingleOrDefault(invoice => invoice.Number == tableId && !invoice.Status);
                if (currentInvoice != null)
                {
                    var list = entity.InvoiceDetails.Where(i => i.ID_Invoice == currentInvoice.ID_Invoice).ToList();
                    List <OrderDetailModel> listOrder = new List <OrderDetailModel>();
                    foreach (var element in list)
                    {
                        var currentMenu
                            = entity.Products.SingleOrDefault(menu => menu.ID_Product == element.ID_Product);
                        var orderDetail = new OrderDetailModel()
                        {
                            ID_HOADON    = element.ID_Invoice,
                            ID_THUCPHAM  = element.ID_Product,
                            SOLUONG      = element.Quantity,
                            TONGTIEN     = element.TotalPrice,
                            URL          = currentMenu.Image,
                            TEN_THUCPHAM = currentMenu.ProductName
                        };
                        listOrder.Add(orderDetail);
                    }
                    model.OrderList = listOrder;
                }
            }
            payment(tableId);
            var report = new PartialViewAsPdf("~/Views/Shared/_PrintBill.cshtml", model)
            {
                RotativaOptions = new DriverOptions()
                {
                    PageSize = Size.A6,
                }
            };

            return(report);
        }
Example #17
0
        private void UpdateCounter(string key, int adjustment, TimeSpan?expireIn)
        {
            QueueCommand(() =>
            {
                var counter = _storage.ObjectRepository.Set <CounterModel>().FirstOrDefault(v => v.Key == key && v.ExpireAt.HasValue == expireIn.HasValue);

                if (counter == null)
                {
                    counter = new CounterModel(key);
                    _storage.ObjectRepository.Add(counter);
                }

                counter.Value += adjustment;
                if (expireIn.HasValue)
                {
                    counter.ExpireAt = DateTime.UtcNow.Add(expireIn.Value);
                }
            });
        }
Example #18
0
        /// <summary>
        /// Shows create counter dialog
        /// </summary>
        public CounterModel ShowCreateCounterDialog(string title, CounterModel counterModel)
        {
            ModalDialog modalDialog = new ModalDialog();

            if (_parentWindow != null)
            {
                modalDialog.Owner = _parentWindow;
            }

            CounterModel      counterModelCopy  = new CounterModel(counterModel);
            CreateCounterView createCounterView = new CreateCounterView(new CounterViewModel(counterModelCopy));

            modalDialog.WindowTitle  = title;
            modalDialog.Body         = createCounterView;
            modalDialog.Confirmation = createCounterView.ViewModel;

            bool?result = ShowDialog(modalDialog);

            return(result == true ? counterModelCopy : null);
        }
Example #19
0
    public String updateOrderHeader(MainModel oModOrder, string counterno, string id)
    {
        String strResult = "";

        strResult = oMainCon.updateOrderHeader(oModOrder);
        if (strResult.Equals("Y"))
        {
            CounterModel oModCounTrans = oMainCon.getCounterTrans(oModOrder.GetSetcomp, counterno, id, "", "");
            if (oModOrder.GetSetorderstatus.Equals("CONFIRMED"))
            {
                oModCounTrans.GetSettotalorderamount = oModCounTrans.GetSettotalorderamount + oModOrder.GetSettotalamount;

                MainModel oModCounTransDet = oMainCon.getCounterTransDetails(oModOrder.GetSetcomp, counterno, id, oModOrder.GetSetorderno);
                oModCounTransDet.GetSetorderstatus = oModOrder.GetSetorderstatus;
                oModCounTransDet.GetSetrowinclude  = true;
                strResult = oMainCon.updateCounterTransDetails(oModCounTransDet);
            }
            strResult = oMainCon.updateCounterTrans(oModCounTrans);
        }
        return(strResult);
    }
        // GET: Counter
        public ActionResult Index()
        {
            var lastvalue = 0;

            using (var counter = new CounterDbEntities())
            {
                var recCount = counter.Counters.Count();
                if (recCount > 0)
                {
                    var lastOrDefault = counter.Counters.Select(c => c.Counter);
                    if (lastOrDefault != null)
                    {
                        lastvalue = lastOrDefault.First();
                    }
                }
            }
            var countermodel = new CounterModel {
                Counter = lastvalue
            };

            return(View(countermodel));
        }
Example #21
0
        public ActionResult Detail(string tableId)
        {
            int          id    = Int32.Parse(tableId);
            CounterModel model = new CounterModel();

            model.TableId         = id;
            model.TableActiveList = entity.Tables.Where(x => x.Status == false && x.Number != id).ToList();
            model.MenuList        = entity.Products.Where(i => i.ID_Product != null).ToList();
            var currentTable = entity.Tables.SingleOrDefault(table => table.Number == id);

            if (currentTable != null)
            {
                var currentInvoice = entity.Invoices.SingleOrDefault(invoice => invoice.Number == id);
                if (currentInvoice != null)
                {
                    var list = entity.InvoiceDetails.Where(i => i.ID_Invoice == currentInvoice.ID_Invoice).ToList();
                    List <OrderDetailModel> listOrder = new List <OrderDetailModel>();
                    foreach (var element in list)
                    {
                        var currentMenu
                            = entity.Products.SingleOrDefault(menu => menu.ID_Product == element.ID_Product);
                        var orderDetail = new OrderDetailModel()
                        {
                            ID_HOADON    = element.ID_Invoice,
                            ID_THUCPHAM  = element.ID_Product,
                            SOLUONG      = element.Quantity,
                            TONGTIEN     = element.TotalPrice,
                            URL          = currentMenu.Image,
                            TEN_THUCPHAM = currentMenu.ProductName,
                            DONGIA       = currentMenu.Price
                        };
                        listOrder.Add(orderDetail);
                    }
                    model.OrderList = listOrder;
                }
            }
            return(View("Detail", model));
        }
Example #22
0
        //[DisableCors]
        public ActionResult <string> Counter([FromBody] CounterModel counter)
        {
            string result = "error";

            try
            {
                DevicesRepository devices = new DevicesRepository(_options);

                if (devices.GetDeviceBySerial(counter.Serial).Count == 0)
                {
                    result = devices.InsertCounter(counter.Serial, counter.Brand, counter.Model, counter.Type);
                }
                else
                {
                    result = "The serial number entered was already registered. Please check the serial number.";
                }
            }
            catch (Exception ex)
            {
                return("Error: " + ex.Message);
            }

            return(result);
        }
Example #23
0
 public String updateCounterMaster(CounterModel oModCounterMaster)
 {
     return(oMainCon.updateCounterMaster(oModCounterMaster));
 }
 public HomeController(CounterModel counter)
 {
     this.counter = counter;
 }
Example #25
0
 public async Task<ActionResult> ProgramApplications(int programId)
 {
     var programs = new CounterModel().GetPrograms(_dbContext, programId);
     var json = await JsonUtil.JsonResultAsync(programs);
     return Content(json, "application/json");
 }
        public ActionResult Index()
        {
            var query = db.tbl_Counters.FirstOrDefault();
            var model = new CounterModel()
            {
                ctr_value = query.ctr_value
            };

            return View(model);
        }
Example #27
0
    public String insertInvoiceHeaderAndDetails(MainModel oModOrdHdr, string counterno, string countertranid)
    {
        String strResult = "";

        if (oModOrdHdr != null ? (oModOrdHdr.GetSetorderno != null ? (oModOrdHdr.GetSetorderno.Length > 0 && oModOrdHdr.GetSetorderstatus.Equals("NEW") ? true : false) : false) : false)
        {
            if (insertShipmentHeaderAndDetails(oModOrdHdr, counterno, countertranid).Equals("Y"))
            {
                oModOrdHdr.GetSetorderstatus   = "CONFIRMED";
                oModOrdHdr.GetSetorderapproved = oModOrdHdr.GetSetordercreated;
                String str1 = updateOrderHeader(oModOrdHdr, counterno, countertranid);
            }
        }
        if (oModOrdHdr != null ? (oModOrdHdr.GetSetorderno != null ? (oModOrdHdr.GetSetorderno.Length > 0 && oModOrdHdr.GetSetorderstatus.Equals("CONFIRMED") ? true : false) : false) : false)
        {
            MainModel oModCounTransDet = oMainCon.getCounterTransDetails(oModOrdHdr.GetSetcomp, counterno, countertranid, oModOrdHdr.GetSetorderno);
            if (oModCounTransDet != null ? oModCounTransDet.GetSetshipmentno != null ? oModCounTransDet.GetSetshipmentno.Length > 0 && oModCounTransDet.GetSetshipmentstatus.Equals("NEW") ? true : false : false : false)
            {
                //get latest information about Shipment Header
                MainModel oModShipment = oMainCon.getShipmentHeaderDetails(oModCounTransDet.GetSetcomp, oModCounTransDet.GetSetshipmentno);

                //proceed create invoice automatically
                //insert invoice header - CONFIRM
                MainModel oModInvoice = new MainModel();
                oModInvoice.GetSetcomp = oModShipment.GetSetcomp;
                //let system define the invoice date
                //oModInvoice.GetSetinvoicedate = oModShipment.GetSetshipmentdate;
                oModInvoice.GetSetinvoicetype = "SALES_INVOICE";
                oModInvoice.GetSetinvoiceterm = "COD";
                oModInvoice.GetSetinvoiceno   = oMainCon.getNextRunningNo(oModCounTransDet.GetSetcomp, "INVOICE", "ACTIVE");
                oModInvoice.GetSetbpid        = oModShipment.GetSetbpid;
                oModInvoice.GetSetbpdesc      = oModShipment.GetSetbpdesc;
                oModInvoice.GetSetbpaddress   = oModShipment.GetSetbpaddress;
                oModInvoice.GetSetbpcontact   = oModShipment.GetSetbpcontact;
                oModInvoice.GetSetremarks     = "INVOICE CREATED BY SYSTEM";
                oModInvoice.GetSetstatus      = "CONFIRMED";
                oModInvoice.GetSetcreatedby   = oModShipment.GetSetcreatedby;
                oModInvoice.GetSetconfirmedby = oModShipment.GetSetcreatedby;

                if (oMainCon.insertInvoiceHeader(oModInvoice).Equals("Y"))
                {
                    oMainCon.updateNextRunningNo(oModShipment.GetSetcomp, "INVOICE", "ACTIVE");

                    //update shipment header as CONFIRMED
                    oModShipment.GetSetstatus      = "CONFIRMED";
                    oModShipment.GetSetconfirmedby = oModShipment.GetSetcreatedby;
                    String result6 = oMainCon.updateShipmentHeader(oModShipment);

                    //get latest information about Invoice Header
                    oModInvoice = oMainCon.getInvoiceHeaderDetails(oModShipment.GetSetcomp, oModInvoice.GetSetinvoiceno);

                    ArrayList lsPendInvLineItem = oMainCon.getLineItemPendingInvoice(oModInvoice.GetSetcomp, oModInvoice.GetSetbpid, "", oModInvoice.GetSetinvoicecat, oModInvoice.GetSetinvoicetype, oModShipment.GetSetshipmentno);

                    for (int y = 0; y < lsPendInvLineItem.Count; y++)
                    {
                        MainModel modPendInv = (MainModel)lsPendInvLineItem[y];

                        MainModel oModLineItem = new MainModel();
                        oModLineItem.GetSetcomp            = modPendInv.GetSetcomp;
                        oModLineItem.GetSetinvoiceno       = oModInvoice.GetSetinvoiceno;
                        oModLineItem.GetSetlineno          = y + 1;
                        oModLineItem.GetSetshipmentno      = modPendInv.GetSetshipmentno;
                        oModLineItem.GetSetshipment_lineno = modPendInv.GetSetlineno;
                        oModLineItem.GetSetorderno         = modPendInv.GetSetorderno;
                        oModLineItem.GetSetorder_lineno    = modPendInv.GetSetorder_lineno;
                        oModLineItem.GetSetitemno          = modPendInv.GetSetitemno;
                        oModLineItem.GetSetitemdesc        = modPendInv.GetSetitemdesc;

                        oModLineItem.GetSetunitcost     = modPendInv.GetSetunitcost;
                        oModLineItem.GetSetcostprice    = modPendInv.GetSetcostprice;
                        oModLineItem.GetSetunitprice    = modPendInv.GetSetunitprice;
                        oModLineItem.GetSetdiscamount   = modPendInv.GetSetdiscamount;
                        oModLineItem.GetSetquantity     = modPendInv.GetSetquantity;
                        oModLineItem.GetSetinvoiceprice = modPendInv.GetSetinvoiceprice;

                        oModLineItem.GetSettaxcode      = modPendInv.GetSettaxcode;
                        oModLineItem.GetSettaxrate      = modPendInv.GetSettaxrate;
                        oModLineItem.GetSettaxamount    = modPendInv.GetSettaxamount;
                        oModLineItem.GetSettotalinvoice = modPendInv.GetSettotalinvoice;

                        String result0 = oMainCon.insertInvoiceDetails(oModLineItem);

                        //to update Sales Order Invoice Amount
                        MainModel oModOrderDet = oMainCon.getOrderDetailsDetails(modPendInv.GetSetcomp, modPendInv.GetSetorderno, modPendInv.GetSetorder_lineno, "");
                        oModOrderDet.GetSetinvoiceamount = oModOrderDet.GetSetinvoiceamount + modPendInv.GetSettotalinvoice;
                        oModOrderDet.GetSetdeliverqty    = oModOrderDet.GetSetdeliverqty + modPendInv.GetSetquantity;
                        String result1 = oMainCon.updateOrderDetails(oModOrderDet);

                        //update status for shipment has invoice
                        MainModel oModShipmentDet = oMainCon.getShipmentDetailsDetails(modPendInv.GetSetcomp, modPendInv.GetSetshipmentno, modPendInv.GetSetlineno, "");

                        //to update item stock & stock transaction
                        MainModel oModLatestItemStock = oMainCon.getItemStockDetails(oModShipmentDet.GetSetcomp, oModShipmentDet.GetSetitemno, oModShipmentDet.GetSetlocation, oModShipmentDet.GetSetdatesoh);
                        if (oModLatestItemStock.GetSetitemcat.Equals("INVENTORY"))
                        {
                            MainModel oModItemStock = new MainModel();
                            oModItemStock.GetSetcomp     = oModShipmentDet.GetSetcomp;
                            oModItemStock.GetSetitemno   = oModShipmentDet.GetSetitemno;
                            oModItemStock.GetSetitemdesc = oModShipmentDet.GetSetitemdesc;
                            oModItemStock.GetSetlocation = oModShipmentDet.GetSetlocation;
                            oModItemStock.GetSetdatesoh  = oModShipmentDet.GetSetdatesoh;
                            oModItemStock.GetSetqtysoh   = oModLatestItemStock.GetSetqtysoh - oModShipmentDet.GetSetshipment_quantity;
                            oModItemStock.GetSetcostsoh  = (oModLatestItemStock.GetSetcostsoh / oModLatestItemStock.GetSetqtysoh) * (oModLatestItemStock.GetSetqtysoh - oModShipmentDet.GetSetshipment_quantity);
                            if (oMainCon.getItemStockList(oModItemStock.GetSetcomp, oModItemStock.GetSetitemno, oModItemStock.GetSetlocation, oModItemStock.GetSetdatesoh, true).Count > 0)
                            {
                                String result2 = oMainCon.updateItemStock(oModItemStock);
                            }

                            MainModel oModItemStockTrans = new MainModel();
                            oModItemStockTrans.GetSetcomp         = oModShipmentDet.GetSetcomp;
                            oModItemStockTrans.GetSetitemno       = oModShipmentDet.GetSetitemno;
                            oModItemStockTrans.GetSetitemdesc     = oModShipmentDet.GetSetitemdesc;
                            oModItemStockTrans.GetSetlocation     = oModShipmentDet.GetSetlocation;
                            oModItemStockTrans.GetSetdatesoh      = oModShipmentDet.GetSetdatesoh;
                            oModItemStockTrans.GetSettranstype    = "SHIPMENT";
                            oModItemStockTrans.GetSettransdate    = oModShipment.GetSetconfirmeddate;
                            oModItemStockTrans.GetSettransno      = oModShipmentDet.GetSetshipmentno;
                            oModItemStockTrans.GetSettrans_lineno = oModShipmentDet.GetSetlineno;
                            oModItemStockTrans.GetSetorderno      = oModShipmentDet.GetSetorderno;
                            oModItemStockTrans.GetSetorder_lineno = oModShipmentDet.GetSetorder_lineno;
                            oModItemStockTrans.GetSettransqty     = oModShipmentDet.GetSetshipment_quantity * -1;
                            oModItemStockTrans.GetSettransprice   = oModLatestItemStock.GetSetcostsoh / oModLatestItemStock.GetSetqtysoh;
                            oModItemStockTrans.GetSetqtysoh       = oModItemStock.GetSetqtysoh;
                            oModItemStockTrans.GetSetcostsoh      = oModItemStock.GetSetcostsoh;
                            String result3 = oMainCon.insertItemStockTransactions(oModItemStockTrans);
                        }

                        oModShipmentDet.GetSethasinvoice = "Y";
                        String result4 = oMainCon.updateShipmentDetails(oModShipmentDet);
                    }//for(int y=0; y <lsShipmentLineItem.Count; y++){
                     //update order header information
                    String result5 = oMainCon.updateInvoiceHeaderInfo(oModInvoice.GetSetcomp, oModInvoice.GetSetinvoiceno);

                    //update CounterTransDetails
                    //get latest info invoice header
                    oModInvoice = oMainCon.getInvoiceHeaderDetails(oModInvoice.GetSetcomp, oModInvoice.GetSetinvoiceno);
                    oModCounTransDet.GetSetshipmentstatus = oModShipment.GetSetstatus;
                    oModCounTransDet.GetSetinvoiceno      = oModInvoice.GetSetinvoiceno;
                    oModCounTransDet.GetSetinvoicedate    = oModInvoice.GetSetinvoicedate;
                    oModCounTransDet.GetSetinvoiceamount  = oModInvoice.GetSettotalamount;
                    oModCounTransDet.GetSetinvoicestatus  = oModInvoice.GetSetstatus;
                    String result7 = oMainCon.updateCounterTransDetails(oModCounTransDet);
                }//if (oMainCon.insertInvoiceHeader(oModInvoice).Equals("Y"))

                CounterModel oModCounTrans = oMainCon.getCounterTrans(oModInvoice.GetSetcomp, counterno, countertranid, "", "");
                if (oModInvoice.GetSetstatus.Equals("CONFIRMED"))
                {
                    oModCounTrans.GetSettotalinvoiceamount = oModCounTrans.GetSettotalinvoiceamount + oModInvoice.GetSettotalamount;
                    strResult = oMainCon.updateCounterTrans(oModCounTrans);
                }
                else
                {
                    strResult = "Y";
                }
            }
            else if (oModCounTransDet != null ? oModCounTransDet.GetSetshipmentno != null ? oModCounTransDet.GetSetshipmentno.Length > 0 && oModCounTransDet.GetSetshipmentstatus.Equals("CONFIRMED") ? (oModCounTransDet.GetSetinvoiceno != null ? oModCounTransDet.GetSetinvoiceno.Length > 0 && oModCounTransDet.GetSetinvoicestatus.Equals("CONFIRMED") ? true : false : false) : false : false : false)
            {
                //already confirm shipment, create invoice & confirm invoice. can proceed to make a payment receipt
                strResult = "Y";
            }
            else
            {
                strResult = "N";
            }
        }
        else
        {
            strResult = "N";
        }
        return(strResult);
    }
Example #28
0
    public String insertPaymentReceiptHeaderAndDetails(MainModel oModOrdHdr, MainModel oModCounTransDet)
    {
        String strResult = "";

        if (oModOrdHdr != null ? (oModOrdHdr.GetSetorderno != null ? (oModOrdHdr.GetSetorderno.Length > 0 && oModOrdHdr.GetSetorderstatus.Equals("CONFIRMED") ? true : false) : false) : false)
        {
            //MainModel oModCounTransDet = oMainCon.getCounterTransDetails(oModOrdHdr.GetSetcomp, counterno, countertranid, oModOrdHdr.GetSetorderno);
            if (oModCounTransDet != null ? oModCounTransDet.GetSetinvoiceno != null ? oModCounTransDet.GetSetinvoiceno.Length > 0 && oModCounTransDet.GetSetinvoicestatus.Equals("CONFIRMED") ? true : false : false : false)
            {
                if (oModCounTransDet != null ? oModCounTransDet.GetSetpayrcptno != null ? oModCounTransDet.GetSetpayrcptno.Length > 0 && oModCounTransDet.GetSetpayrcptstatus.Equals("CONFIRMED") ? true : false : false : false)
                {
                    strResult = "Y";
                }
                else
                {
                    //get latest information about Invoice Header
                    MainModel oModInvoice = oMainCon.getInvoiceHeaderDetails(oModOrdHdr.GetSetcomp, oModCounTransDet.GetSetinvoiceno);

                    MainModel oModPayRcpt = new MainModel();
                    oModPayRcpt.GetSetcomp = oModInvoice.GetSetcomp;
                    //let system define the invoice date
                    //oModPayRcpt.GetSetpayrcptdate = oMainCon.replaceNull(Request.Params.Get("payrcptdate"));
                    oModPayRcpt.GetSetpayrcpttype = "INVOICE";
                    oModPayRcpt.GetSetpayrcptno   = oMainCon.getNextRunningNo(oModPayRcpt.GetSetcomp, "PAYMENT_RECEIPT", "ACTIVE");
                    oModPayRcpt.GetSetbpid        = oModInvoice.GetSetbpid;
                    oModPayRcpt.GetSetbpdesc      = oModInvoice.GetSetbpdesc;
                    oModPayRcpt.GetSetbpaddress   = oModInvoice.GetSetbpaddress;
                    oModPayRcpt.GetSetbpcontact   = oModInvoice.GetSetbpcontact;
                    oModPayRcpt.GetSetremarks     = "PAYMENT RECEIPT CREATED BY SYSTEM";;
                    oModPayRcpt.GetSetstatus      = "CONFIRMED";
                    oModPayRcpt.GetSetcreatedby   = oModInvoice.GetSetcreatedby;
                    oModPayRcpt.GetSetconfirmedby = oModInvoice.GetSetcreatedby;

                    if (oMainCon.insertPaymentReceiptHeader(oModPayRcpt).Equals("Y"))
                    {
                        oMainCon.updateNextRunningNo(oModPayRcpt.GetSetcomp, "PAYMENT_RECEIPT", "ACTIVE");

                        MainModel oModLineItem = new MainModel();
                        oModLineItem.GetSetcomp         = oModPayRcpt.GetSetcomp;
                        oModLineItem.GetSetpayrcptno    = oModPayRcpt.GetSetpayrcptno;
                        oModLineItem.GetSetlineno       = 1;
                        oModLineItem.GetSetinvoiceno    = oModCounTransDet.GetSetinvoiceno;
                        oModLineItem.GetSetinvoicedate  = oModCounTransDet.GetSetinvoicedate;
                        oModLineItem.GetSetinvoiceprice = oModCounTransDet.GetSetinvoiceamount;
                        oModLineItem.GetSetpaytype      = oModOrdHdr.GetSetpaytype;
                        oModLineItem.GetSetpayrefno     = oModCounTransDet.GetSetcounterno;
                        oModLineItem.GetSetpayrcptprice = oModCounTransDet.GetSetpayrcptamount;
                        oModLineItem.GetSetpayremarks   = oModPayRcpt.GetSetremarks;

                        //insert new line item
                        String result2 = oMainCon.insertPaymentReceiptDetails(oModLineItem);

                        /*
                         * ArrayList lsPendPayRcptMod = oMainCon.getLineItemPendingPaymentReceipt(oModInvoice.GetSetcomp, oModInvoice.GetSetbpid, oModInvoice.GetSetbpdesc, oModInvoice.GetSetinvoiceno);
                         * for (int y = 0; y < lsPendPayRcptMod.Count; y++)
                         * {
                         *  MainModel modPendPayment = (MainModel)lsPendPayRcptMod[y];
                         *
                         *  MainModel oModLineItem = new MainModel();
                         *  oModLineItem.GetSetcomp = oModPayRcpt.GetSetcomp;
                         *  oModLineItem.GetSetpayrcptno = oModPayRcpt.GetSetpayrcptno;
                         *  oModLineItem.GetSetlineno = y + 1;
                         *  oModLineItem.GetSetinvoiceno = modPendPayment.GetSetinvoiceno;
                         *  oModLineItem.GetSetinvoicedate = modPendPayment.GetSetinvoicedate;
                         *  oModLineItem.GetSetinvoiceprice = modPendPayment.GetSettotalamount - modPendPayment.GetSetpayrcptamount;
                         *  oModLineItem.GetSetpaytype = oModPayRcpt.GetSetpayrcpttype;
                         *  oModLineItem.GetSetpayrefno = oModCounTransDet.GetSetcounterno;
                         *  oModLineItem.GetSetpayrcptprice = oModCounTransDet.GetSetpayrcptamount;
                         *  oModLineItem.GetSetpayremarks = oModPayRcpt.GetSetremarks;
                         *
                         *  //insert new line item
                         *  String result2 = oMainCon.insertPaymentReceiptDetails(oModLineItem);
                         *
                         * }
                         */

                        //update payment receipt header information
                        String result3 = oMainCon.updatePaymentReceiptHeaderInfo(oModPayRcpt.GetSetcomp, oModPayRcpt.GetSetpayrcptno);

                        //update CounterTransDetails
                        //get latest info invoice header
                        oModPayRcpt = oMainCon.getPaymentReceiptHeaderDetails(oModPayRcpt.GetSetcomp, oModPayRcpt.GetSetpayrcptno);
                        oModCounTransDet.GetSetpayrcptno   = oModPayRcpt.GetSetpayrcptno;
                        oModCounTransDet.GetSetpayrcptdate = oModPayRcpt.GetSetpayrcptdate;
                        //oModCounTransDet.GetSetpayrcptamount = oModPayRcpt.GetSetpayrcptamount;
                        oModCounTransDet.GetSetpayrcptstatus = oModPayRcpt.GetSetstatus;
                        String result4 = oMainCon.updateCounterTransDetails(oModCounTransDet);
                    }

                    CounterModel oModCounTrans = oMainCon.getCounterTrans(oModCounTransDet.GetSetcomp, oModCounTransDet.GetSetcounterno, oModCounTransDet.GetSetcountertranid, "", "");
                    if (oModPayRcpt.GetSetstatus.Equals("CONFIRMED"))
                    {
                        oModCounTrans.GetSettotalpayrcptamount = oModCounTrans.GetSettotalpayrcptamount + oModPayRcpt.GetSetpayrcptamount;
                        oModCounTrans.GetSetclosingbalance     = oModCounTrans.GetSetopeningbalance + oModCounTrans.GetSettotalpayrcptamount;
                        strResult = oMainCon.updateCounterTrans(oModCounTrans);
                    }
                    else
                    {
                        strResult = "Y";
                    }
                }
            }
            else
            {
                strResult = "N";
            }
        }
        else
        {
            strResult = "N";
        }

        return(strResult);
    }
Example #29
0
 public string set(CounterModel order)
 {
     state.SetCounter(order.Counter);
     return("ok");
 }
Example #30
0
 public String insertCounterTrans(CounterModel oModCounterTrans)
 {
     return(oMainCon.insertCounterTrans(oModCounterTrans));
 }
Example #31
0
 public String insertCounterMaster(CounterModel oModCounterMaster)
 {
     return(oMainCon.insertCounterMaster(oModCounterMaster));
 }
Example #32
0
 public String updateCounterTrans(CounterModel oModCounterTrans)
 {
     return(oMainCon.updateCounterTrans(oModCounterTrans));
 }