private decimal?CalculateCommission(MEmployee emp, MItem mItem, decimal?totalTrans)
        {
            decimal?commission     = 0;
            string  typeCommission = emp.EmployeeCommissionProductType;
            decimal?commissionVal  = emp.EmployeeCommissionProductVal;

            if (typeCommission == EnumCommissionType.Percent.ToString())
            {
                commission = totalTrans * (commissionVal / 100);
            }
            else
            {
                commission = commissionVal;
            }
            return(commission);
        }
        void itemIdTextBox_Validating(object sender, CancelEventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                MItem item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, itemIdTextBox.Text);

                if (item != null)
                {
                    itemNameTextBox.Text = item.ItemName;
                }
                else
                {
                    itemNameTextBox.Text = string.Empty;
                }
            }
        }
Esempio n. 3
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    item = (MItem)DataMaster.GetObjectById(typeof(MItem), itemIdTextBox.Text);
                    DataMaster.Delete(item);

                    ItemGudangStok stok = (ItemGudangStok)DataMaster.GetObjectByProperty(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemIdTextBox.Text, ItemGudangStok.ColumnNames.GudangId, defaultGudangIdComboBox.SelectedValue);
                    DataMaster.Delete(stok);
                    ModuleControlSettings.SaveLog(ListOfAction.Delete, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text);
                    BindData();
                }
            }
        }
Esempio n. 4
0
        public decimal?GetTotalUsed(MItem item, MWarehouse warehouse, DateTime?dateFrom, DateTime?dateTo, string transStatus)
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendLine(
                @"   select sum(det.TransDetQty)
                                from TTransDet as det
                                    left outer join det.TransId trans
                                where det.DataStatus <> :dataStatus 
                                    and  trans.TransStatus = :TransStatus ");
            if (item != null)
            {
                sql.AppendLine(@"   and det.ItemId = :item");
            }
            if (warehouse != null)
            {
                sql.AppendLine(@"   and trans.WarehouseId = :warehouse");
            }
            if (dateFrom.HasValue && dateTo.HasValue)
            {
                sql.AppendLine(@"   and trans.TransDate between :dateFrom and :dateTo ");
            }

            IQuery q = Session.CreateQuery(sql.ToString());

            q.SetString("dataStatus", EnumDataStatus.Deleted.ToString());
            q.SetString("TransStatus", transStatus);
            if (item != null)
            {
                q.SetEntity("item", item);
            }
            if (warehouse != null)
            {
                q.SetEntity("warehouse", warehouse);
            }
            if (dateFrom.HasValue && dateTo.HasValue)
            {
                q.SetDateTime("dateFrom", dateFrom.Value);
                q.SetDateTime("dateTo", dateTo.Value);
            }

            if (q.UniqueResult() != null)
            {
                return((decimal)q.UniqueResult());
            }
            return(null);
        }
Esempio n. 5
0
        public async Task <IActionResult> EditItem(int id, MItem mitem, IFormFile MainImage)
        {
            if (AuthenticateUser())
            {
                if (id != mitem.Id)
                {
                    return(NotFound());
                }

                if (ModelState.IsValid)
                {
                    try
                    {
                        if (MainImage != null)
                        {
                            string     FileName = Guid.NewGuid().ToString() + Path.GetExtension(MainImage.FileName);
                            string     FilePath = _env.WebRootPath + "/SystemData/CategoryPicture/";
                            FileStream FS       = new FileStream(FilePath + FileName, FileMode.Create);
                            MainImage.CopyTo(FS);
                            FS.Close();
                            mitem.MainImage = "/SystemData/CategoryPicture/" + FileName;
                        }
                        _context.Update(mitem);
                        await _context.SaveChangesAsync();
                    }
                    catch (DbUpdateConcurrencyException)
                    {
                        if (!MUserExists(mitem.Id))
                        {
                            return(NotFound());
                        }
                        else
                        {
                            throw;
                        }
                    }
                    return(RedirectToAction(nameof(ExistingItem)));
                }
                return(View(mitem));
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }
Esempio n. 6
0
        public static ReportParamViewModel CreateReportParamViewModel(IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMItemRepository mItemRepository)
        {
            ReportParamViewModel viewModel = new ReportParamViewModel();

            IList <MWarehouse> listWarehouse = mWarehouseRepository.GetAll();
            MWarehouse         account       = new MWarehouse();

            account.WarehouseName = "-Semua Gudang-";
            listWarehouse.Insert(0, account);
            viewModel.WarehouseList = new SelectList(listWarehouse, "Id", "WarehouseName");

            IList <MSupplier> listSupplier = mSupplierRepository.GetAll();
            MSupplier         supplier     = new MSupplier();

            supplier.SupplierName = "-Semua Supplier-";
            listSupplier.Insert(0, supplier);
            viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            //IList<TRecPeriod> listRecPeriod = tRecPeriodRepository.GetAll();
            ////TRecPeriod recPeriod = new TRecPeriod();
            ////recPeriod.PeriodDesc = "-Pilih Period-";
            ////listRecPeriod.Insert(0, recPeriod);
            //viewModel.RecPeriodList = new SelectList(listRecPeriod, "Id", "PeriodDesc");

            IList <MItem> listItem = mItemRepository.GetAll();
            MItem         item     = new MItem();

            item.ItemName = "-Semua Item-";
            listItem.Insert(0, item);
            viewModel.ItemList = new SelectList(listItem, "Id", "ItemName");

            ArrayList arr = new ArrayList();

            for (int i = 1; i <= 5; i++)
            {
                var sel = new { Id = i };
                arr.Add(sel);
            }
            viewModel.ShiftNoList = new SelectList(arr, "Id", "Id");

            viewModel.DateFrom = DateTime.Today;
            viewModel.DateTo   = DateTime.Today;

            return(viewModel);
        }
Esempio n. 7
0
        private void createMenuSpell(MItem item, int defaultValue, String parent, int minManaPct, bool useMana, bool useOn = true)
        {
            var abilitySlot = Utility.GetSpellSlot(_player, item.name, false);

            if (abilitySlot != SpellSlot.Unknown && abilitySlot == item.abilitySlot)
            {
                Config.SubMenu(parent).AddItem(new MenuItem(item.menuVariable, item.menuName)).SetValue(true);
                if (useOn)
                {
                    Config.SubMenu(parent).AddItem(new MenuItem(item.menuVariable + "MinHpPct", "Min Damage %")).SetValue(new Slider(10, 0, 100));
                    Config.SubMenu(parent).AddItem(new MenuItem(item.menuVariable + "UseOnPercent", "Use on HP%")).SetValue(new Slider(defaultValue, 0, 100));
                    if (useMana)
                    {
                        Config.SubMenu(parent).AddItem(new MenuItem(item.menuVariable + "UseManaPct", "Min Mana%")).SetValue(new Slider(minManaPct, 0, 100));
                    }
                }
            }
        }
Esempio n. 8
0
        public virtual ActionResult GetList()
        {
            var           items = _mItemRepository.GetAll();
            StringBuilder sb    = new StringBuilder();
            MItem         mItem = new MItem();

            sb.AppendFormat("{0}:{1};", string.Empty, "-Pilih Produk-");
            for (int i = 0; i < items.Count; i++)
            {
                mItem = items[i];
                sb.AppendFormat("{0}:{1}", mItem.Id, mItem.ItemName);
                if (i < items.Count - 1)
                {
                    sb.Append(";");
                }
            }
            return(Content(sb.ToString()));
        }
Esempio n. 9
0
        internal static void FillItemComboBox(ComboBox itemIdComboBox)
        {
            DataMasterMgtServices DataMaster = new DataMasterMgtServices();

            itemIdComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

            NHibernate.Expression.Order[] orderArrays = new NHibernate.Expression.Order[1];
            orderArrays[0] = NHibernate.Expression.Order.Asc(MItem.ColumnNames.ItemName);
            IList list = DataMaster.GetList(typeof(MItem), null, orderArrays);

            MItem item = new MItem();

            item.ItemName = "- Type Unit -";
            list.Insert(0, item);

            //DataTable dt = new DataTable();
            //dt.Columns.Add(MItem.ColumnNames.ItemId);
            //dt.Columns.Add(MItem.ColumnNames.ItemName);

            //DataRow dr;

            //IList listItemType = DataMaster.GetAll(typeof(MItem));

            //MItem item = new MItem();
            //item.ItemName = "- Type Unit -";
            //dr = dt.NewRow();
            //dr[0] = item.ItemId;
            //dr[1] = item.ItemName;
            //dt.Rows.Add(dr);

            //for (int i = 0; i < listItemType.Count; i++)
            //{
            //    item = (MItem)listItemType[i];
            //    dr = dt.NewRow();
            //    dr[0] = item.ItemId;
            //    dr[1] = item.ItemName;
            //    dt.Rows.Add(dr);
            //}

            itemIdComboBox.DataSource    = list;
            itemIdComboBox.DisplayMember = MItem.ColumnNames.ItemName;
            itemIdComboBox.ValueMember   = MItem.ColumnNames.ItemId;
            itemIdComboBox.Show();
        }
Esempio n. 10
0
        public ActionResult Insert(MItem viewModel, FormCollection formCollection)
        {
            MItem mItemToInsert = new MItem();

            TransferFormValuesTo(mItemToInsert, viewModel);
            mItemToInsert.ItemCatId = _mItemCatRepository.Get(formCollection["ItemCatId"]);
            mItemToInsert.BrandId   = _mBrandRepository.Get(formCollection["BrandId"]);

            mItemToInsert.SetAssignedIdTo(viewModel.Id);
            mItemToInsert.CreatedDate = DateTime.Now;
            mItemToInsert.CreatedBy   = User.Identity.Name;
            mItemToInsert.DataStatus  = EnumDataStatus.New.ToString();

            //IList<MItemUom> listItemUom = new List<MItemUom>();

            mItemToInsert.ItemUoms.Clear();

            MItemUom itemUom = new MItemUom(mItemToInsert);

            itemUom.ItemUomName = formCollection["ItemUomName"];
            UpdateNumericData(itemUom, formCollection);
            //itemUom.ItemUomPurchasePrice = Convert.ToDecimal(formCollection["ItemUomPurchasePrice"]);
            itemUom.SetAssignedIdTo(Guid.NewGuid().ToString());

            mItemToInsert.ItemUoms.Add(itemUom);

            //mItemToInsert.ItemUoms = listItemUom;

            _mItemRepository.Save(mItemToInsert);

            try
            {
                _mItemRepository.DbContext.CommitChanges();
            }
            catch (Exception e)
            {
                _mItemRepository.DbContext.RollbackTransaction();

                //throw e.GetBaseException();
                return(Content(e.GetBaseException().Message));
            }

            return(Content("success"));
        }
Esempio n. 11
0
        private void ApplyParameters(PlayerToken playToken)
        {
            MItem mitem = playToken.MItem;
            //IPlayParameters parameters = playToken.Parameters;
            //if (parameters != null)
            {
                //((IMProps)mitem).PropsSet("file::interlace", EnumUtils.GetInterlaceString(playToken.Parameters.MPFieldsType));
                //((IMProps)mitem).PropsSet("file::scale_type", EnumUtils.GetScaleTypeString(playToken.Parameters.StretchMode));
                //((IMProps)mitem).PropsSet("file::aspect_ratio", EnumUtils.GetAspectRatioString(playToken.Parameters.AspectRatio));
                if (playToken.HasAudio && IsMLSource(playToken.MediaSource))
                {
                    IFileMediaSource fileSource = playToken.MediaSource as IFileMediaSource;

                    this.SetAudioGain((MItemClass)mitem, fileSource.AudioGain);
                }
            }

            // TODO: add other parameters
        }
Esempio n. 12
0
        private PlayRange SetInOut(MItem mitem, PlayRange playRange)
        {
            double dblIn = 0.0, dblOut = 0.0;

            dblIn  = playRange.StartPosition.TotalSeconds;
            dblOut = playRange.StopPosition.TotalSeconds;

            mitem.FileInOutSet(dblIn, dblOut);

            double dblDuration;

            mitem.FileInOutGet(out dblIn, out dblOut, out dblDuration);
            if (dblOut == dblIn || dblOut == 0.0)
            {
                dblOut = dblDuration;
            }

            return(new PlayRange(TimeSpan.FromSeconds(dblIn), TimeSpan.FromSeconds(dblOut - dblIn)));
        }
Esempio n. 13
0
        public MItem GetItemPointer(int type, int pos)
        {
            MItem sour = MItem.Empty();

            if (type == 0)
            {
                if (pos < 0 || pos >= 16)
                {
                    return(MItem.Empty());
                }

                sour = Account.Mob[Slot].Equip.Items[pos];
            }
            else if (type == 1)
            {
                if (pos < 0 || pos >= 64)
                {
                    return(MItem.Empty());
                }

                sour = Account.Mob[Slot].Carry.Items[pos];
            }
            else if (type == 2)
            {
                if (pos < 0 || pos >= 128)
                {
                    return(MItem.Empty());
                }

                sour = Account.Cargo.Items[pos];
            }
            else
            {
                return(MItem.Empty());
            }

            if (sour.Index < 0 || sour.Index >= 6500)
            {
                return(MItem.Empty());
            }

            return(sour);
        }
Esempio n. 14
0
        public static ReportParamViewModel CreateReportParamViewModel(IMCostCenterRepository mCostCenterRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, ITRecPeriodRepository tRecPeriodRepository, IMItemRepository mItemRepository)
        {
            ReportParamViewModel viewModel = new ReportParamViewModel();

            IList <MCostCenter> list       = mCostCenterRepository.GetAll();
            MCostCenter         costCenter = new MCostCenter();

            costCenter.CostCenterName = "-Semua Cost Center-";
            list.Insert(0, costCenter);
            viewModel.CostCenterList = new SelectList(list, "Id", "CostCenterName");

            IList <MWarehouse> listWarehouse = mWarehouseRepository.GetAll();
            MWarehouse         account       = new MWarehouse();

            account.WarehouseName = "-Semua Gudang-";
            listWarehouse.Insert(0, account);
            viewModel.WarehouseList = new SelectList(listWarehouse, "Id", "WarehouseName");

            IList <MSupplier> listSupplier = mSupplierRepository.GetAll();
            MSupplier         supplier     = new MSupplier();

            supplier.SupplierName = "-Semua Supplier-";
            listSupplier.Insert(0, supplier);
            viewModel.SupplierList = new SelectList(listSupplier, "Id", "SupplierName");

            IList <TRecPeriod> listRecPeriod = tRecPeriodRepository.GetAll();
            TRecPeriod         recPeriod     = new TRecPeriod();

            recPeriod.PeriodDesc = "-Pilih Period-";
            listRecPeriod.Insert(0, recPeriod);
            viewModel.RecPeriodList = new SelectList(listRecPeriod, "Id", "PeriodDesc");

            IList <MItem> listItem = mItemRepository.GetAll();
            MItem         item     = new MItem();

            item.ItemName = "-Semua Item-";
            listItem.Insert(0, item);
            viewModel.ItemList = new SelectList(listItem, "Id", "ItemName");

            viewModel.DateFrom = DateTime.Today;
            viewModel.DateTo   = DateTime.Today;
            return(viewModel);
        }
Esempio n. 15
0
        /// <summary>
        /// Panel click
        /// </summary>
        private void OnPanelClick(object sender, EventArgs e)
        {
            if (Items.Count > 0)
            {
                foreach (MItem item in DisplayedItems)
                {
                    if (item.Bounds.Contains(MousePosition))
                    {
                        // Ignore dividers
                        if (item is MDividerItem)
                        {
                            continue;
                        }

                        SelectedItem = item;
                        SelectedItemChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedItemChanged"));
                    }
                }
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Panel mouse leave
        /// </summary>
        private void OnPanelMouseLeave(object sender, EventArgs e)
        {
            // Update mouse location
            mouseLocation = new Point(-1, -1);

            // Refresh control
            Refresh();

            // Mouse events
            MouseEventArgs args = new MouseEventArgs(MouseButtons.None, 0, Cursor.Position.X, Cursor.Position.Y, 0);

            // Call mouse leave on temp item
            if (_tempItem != null)
            {
                _tempItem.TriggerMouseLeave(this, args);
            }

            // Reset temporary item
            _tempItem = null;
        }
Esempio n. 17
0
        public override void Update()
        {
            base.Update();
            if (!isOn)
            {
                return;
            }
            if (Program.WaitFrame(10))
            {
                ConsoleColor rColor = Dice.NextColor();

                for (int i = 0; i < Image.Count; i++)
                {
                    MItem mi = Image[i];
                    mi.fColor = rColor;
                    Image[i]  = mi;
                }
                NowScene.Ins.ReFreshGameObject(this);
            }
        }
Esempio n. 18
0
        private void itemIdTextBox_Validating(object sender, CancelEventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                MItem item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, itemIdTextBox.Text);

                if (item != null)
                {
                    itemNameTextBox.Text = item.ItemName;
                    itemPricePurchaseNumericUpDown.Value    = item.ItemPricePurchase;
                    itemPricePurchaseAvgNumericUpDown.Value = item.ItemPricePurchaseAvg;
                }
                else
                {
                    itemNameTextBox.ResetText();
                    itemPricePurchaseNumericUpDown.Value    = decimal.Zero;
                    itemPricePurchaseAvgNumericUpDown.Value = decimal.Zero;
                }
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Scrolls to item
        /// </summary>
        public bool ScrollToItem(MItem item)
        {
            if (Items.Count > 0)
            {
                foreach (MItem searchedItem in DisplayedItems)
                {
                    if (searchedItem == item)
                    {
                        Panel.AutoScrollPosition = new Point(0, searchedItem.Bounds.Y);
                        Scrollbar.Value          = searchedItem.Bounds.Y;

                        // Success
                        return(true);
                    }
                }
            }

            // Fail
            return(false);
        }
Esempio n. 20
0
        public void BuildMenu(List <List <Element> > flyoutGroups)
        {
            var groups = new List <MGroup>();

            _flyoutMenu.Clear();

            for (int i = 0; i < flyoutGroups.Count; i++)
            {
                var flyoutGroup = flyoutGroups[i];
                var items       = new List <MItem>();
                for (int j = 0; j < flyoutGroup.Count; j++)
                {
                    string title = null;
                    string icon  = null;
                    if (flyoutGroup[j] is BaseShellItem shellItem)
                    {
                        title = shellItem.Title;

                        if (shellItem.FlyoutIcon is FileImageSource flyoutIcon)
                        {
                            icon = flyoutIcon.File;
                        }
                    }
                    else if (flyoutGroup[j] is MenuItem menuItem)
                    {
                        title = menuItem.Text;
                        if (menuItem.IconImageSource != null && menuItem.IconImageSource is FileImageSource fileImageSource)
                        {
                            icon = fileImageSource.File;
                        }
                    }
                    MItem item = new MItem(title, icon);
                    items.Add(item);

                    _flyoutMenu.Add(item, flyoutGroup[j]);
                }
                var group = new MGroup(items);
                groups.Add(group);
            }
            GroupMenu = groups;
        }
Esempio n. 21
0
        public IList GetSisaStockList(MItem itemId, MWarehouse mWarehouse)
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendLine(@"  select s, (s.StockQty - isnull(sum(r.StockRefQty),0))
                                from TStock s
                                    left join s.StockRefs r ");
            sql.AppendLine(@"   where s.ItemId = :itemId");
            sql.AppendLine(@"       and s.WarehouseId = :mWarehouse");
            sql.AppendLine(@"   group by s, s.ItemId, s.WarehouseId, s.TransDetId , s.StockDate , s.StockQty , s.StockPrice , s.StockStatus , s.StockDesc , s.DataStatus , s.CreatedBy , s.CreatedDate , s.ModifiedBy , s.ModifiedDate , s.RowVersion   ");
            sql.AppendLine(@"   having (s.StockQty - isnull(sum(r.StockRefQty),0)) > 0 ");
            sql.AppendLine(@"   order by s.StockDate asc");

            IQuery q = Session.CreateQuery(sql.ToString());

            q.SetEntity("itemId", itemId);
            q.SetEntity("mWarehouse", mWarehouse);


            return(q.List());
        }
Esempio n. 22
0
        public ActionResult Delete(MItem viewModel, FormCollection formCollection)
        {
            MItem mItemToDelete = _mItemRepository.Get(viewModel.Id);

            if (mItemToDelete != null)
            {
                _mItemRepository.Delete(mItemToDelete);
            }

            try
            {
                _mItemRepository.DbContext.CommitChanges();
            }
            catch (Exception e)
            {
                _mItemRepository.DbContext.RollbackTransaction();

                return(Content(e.GetBaseException().Message));
            }

            return(Content("success"));
        }
Esempio n. 23
0
        private void itemIdTextBox_Validating(object sender, CancelEventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                MItem item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, itemIdTextBox.Text);

                if (item != null)
                {
                    itemNameTextBox.Text = item.ItemName;

                    if (trans.Equals(ListOfTransaction.Sales))
                    {
                        if (transactionByNameComboBox.SelectedIndex != -1)
                        {
                            MCustomerGroup custGroup = (MCustomerGroup)DataMaster.GetObjectByProperty(typeof(MCustomerGroup), MCustomerGroup.ColumnNames.CustomerGroupId, transactionByNameComboBox.SelectedValue.ToString());
                            decimal        persen    = 0;
                            if (custGroup != null)
                            {
                                persen = custGroup.CustomerGroupPercentage;
                            }
                            priceNumericUpDown.Value = item.ItemPricePurchase * (1 + (persen / 100));
                        }
                        else
                        {
                            MessageBox.Show("Kategori Pelanggan belum dipilih!", "Error !!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            ResetTransactionDetail();
                            transactionByNameComboBox.Select();
                        }
                    }
                    else if (trans.Equals(ListOfTransaction.Purchase) || trans.Equals(ListOfTransaction.ReturPurchase))
                    {
                        priceNumericUpDown.Value = item.ItemPricePurchase;
                    }

                    //if (!trans.Equals(ListOfTransaction.Correction))
                    //    num_Price.Value = item.ItemPriceMax;
                }
            }
        }
Esempio n. 24
0
        private void dataGridViewFiles_DragDrop(object sender, DragEventArgs e)
        {
            string[] arrStrFiles = (string[])e.Data.GetData(DataFormats.FileDrop);
            MItem    pFile       = null;

            try
            {
                for (int i = 0; i < arrStrFiles.Length; i++)
                {
                    int nIndex = -1;
                    m_objPlaylist.PlaylistAdd(null, arrStrFiles[i], "", ref nIndex, out pFile);
                }
            }
            catch (Exception) { }

            if (pFile != null)
            {
                System.Runtime.InteropServices.Marshal.ReleaseComObject(pFile);
                GC.Collect();
            }
            updateList();
        }
Esempio n. 25
0
    private void ChangeSelect(float input)
    {
        if (currentSelected != null)
        {
            list[currentSelected.index - 1].isActive = false;
            currentSelected.isActive = false;
            if (input < 0)
            {
                if (currentSelected.index != list.Count)
                {
                    currentSelected = list[currentSelected.index];
                }
                else
                {
                    return;
                }
            }

            if (input > 0)
            {
                if (currentSelected.index != 1)
                {
                    currentSelected = list[currentSelected.index - 2];
                }
                else
                {
                    return;
                }
            }
        }
        else
        {
            currentSelected = list[0];
        }

        list[currentSelected.index - 1].isActive = true;
        SelectedChange(this, new ButtonEventArgs(currentSelected.name));
    }
Esempio n. 26
0
        private ReportDataSource GetTransDetForBudget(string itemId, string warehouseId, DateTime dateFrom, DateTime dateTo)
        {
            IList <TTransDet> dets;
            MItem             item      = null;
            MWarehouse        warehouse = null;

            if (!string.IsNullOrEmpty(itemId))
            {
                item = _mItemRepository.Get(itemId);
            }
            if (!string.IsNullOrEmpty(warehouseId))
            {
                warehouse = _mWarehouseRepository.Get(warehouseId);
            }
            dets = _tTransDetRepository.GetByItemWarehouse(item, warehouse);

            var list = from det in dets
                       select new
            {
                det.TransDetNo,
                det.TransDetQty,
                det.TransDetDesc,
                det.TransDetTotal,
                det.TransDetPrice,
                det.TransDetDisc,
                ItemId = det.ItemId.Id,
                det.ItemId.ItemName,
                WarehouseId = det.TransId.WarehouseId.Id,
                det.TransId.WarehouseId.WarehouseName,
                TotalUsed        = _tTransDetRepository.GetTotalUsed(det.ItemId, det.TransId.WarehouseId, dateFrom, dateTo, EnumTransactionStatus.Using.ToString()),
                RealPercentValue = GetRealValue(det.TransId.WarehouseId.CostCenterId, dateFrom, dateTo)
            }
            ;

            ReportDataSource reportDataSource = new ReportDataSource("TransDetViewModel", list.ToList());

            return(reportDataSource);
        }
Esempio n. 27
0
        public void Close()
        {
            if (_mplaylist != null && this.Status != PreviewPlayerStatus.Closed)
            {
                if (_mitem != null)
                {
                    _mplaylist.FilePlayStop(0.0);

                    _mplaylist.PlaylistRemove(_mitem);

                    Marshal.ReleaseComObject(_mitem);
                    _mitem = null;
                }
                _mplaylist.ObjectClose();

                this.Duration = 0.0;
                this.Name     = null;

                this.Status = PreviewPlayerStatus.Closed;

                OnClosed();
            }
        }
Esempio n. 28
0
        private ReportDataSource GetTransDetForBudget(string itemId, string warehouseId)
        {
            IList <TTransDet> dets;
            MItem             item      = null;
            MWarehouse        warehouse = null;

            if (!string.IsNullOrEmpty(itemId))
            {
                item = _mItemRepository.Get(itemId);
            }
            if (!string.IsNullOrEmpty(warehouseId))
            {
                warehouse = _mWarehouseRepository.Get(warehouseId);
            }
            dets = _tTransDetRepository.GetByItemWarehouse(item, warehouse);

            var list = from det in dets
                       select new
            {
                det.TransDetNo,
                det.TransDetQty,
                det.TransDetDesc,
                det.TransDetTotal,
                det.TransDetPrice,
                det.TransDetDisc,
                ItemId = det.ItemId.Id,
                det.ItemId.ItemName,
                WarehouseId = det.TransId.WarehouseId.Id,
                det.TransId.WarehouseId.WarehouseName,
                TotalUsed = _tTransDetRepository.GetTotalUsed(det.ItemId, det.TransId.WarehouseId)
            }
            ;

            ReportDataSource reportDataSource = new ReportDataSource("TransDetViewModel", list.ToList());

            return(reportDataSource);
        }
Esempio n. 29
0
        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(itemIdTextBox.Text.Trim()))
            {
                if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    item = (MItem)DataMaster.GetObjectByProperty(typeof(MItem), MItem.ColumnNames.ItemId, itemIdTextBox.Text);
                    DataMaster.Delete(item);

                    IList          listStok = DataMaster.GetListEq(typeof(ItemGudangStok), ItemGudangStok.ColumnNames.ItemId, itemIdTextBox.Text);
                    ItemGudangStok stok;
                    for (int i = 0; i < listStok.Count; i++)
                    {
                        stok = (ItemGudangStok)listStok[i];
                        if (stok != null)
                        {
                            DataMaster.Delete(stok);
                        }
                    }
                    ModuleControlSettings.SaveLog(ListOfAction.Delete, itemIdTextBox.Text, ListOfTable.MItem, lbl_UserName.Text);
                    BindData();
                }
            }
        }
Esempio n. 30
0
        public List <MItem> AddDxy(List <MItem> old, int dx, int dy, int layer = -1000, int vb = -1)
        {
            List <MItem> res = new List <MItem>();

            foreach (MItem item in old)
            {
                MItem temp = item;
                temp.position = new Vector2(temp.position.X + dx, temp.position.Y + dy);
                if (layer != -1000)
                {
                    temp.layer = layer;
                }
                if (vb == 1)
                {
                    temp.isVisible = true;
                }
                else if (vb == 0)
                {
                    temp.isVisible = false;
                }
                res.Add(temp);
            }
            return(res);
        }
Esempio n. 31
0
 static void AddUnits(ref System.Collections.Generic.Dictionary<string, MItem> dic, MItem unit, params string[] names)
 {
   foreach (var name in names)
     dic.Add(name, unit);
 }
Esempio n. 32
0
 static void matchInternal(MItem unit, SMath.Math.Numeric.TNumber val, ref SMath.Math.Store context)
 {
   // First, reduce our units to basic representation to allow MathEqual()
   var t = SMath.Math.Decision.Preprocessing(unit.ToTerms(), ref context);
   var u = Expression.SimplifyEx(Converter.ToMItem(t), context);
   if (!val.obj.Units.MathEqual(u) && !val.obj.Units.MathEqual(unitless))
     throw new SMath.Manager.EvaluationException(SMath.Manager.Errors.UnitsDontMatch);
 }