예제 #1
0
        private void LoadData()
        {
            this.Title = Caption;

            CTable t = new CTable("INVENTORY_TX");

            vw = new MInventoryTransaction(t);
            //vw.LocationObj = this.locationObj;
            vw.CreateDefaultValue();

            DataContext = vw;

            CUtil.EnableForm(false, this);

            if (Mode.Equals("E"))
            {
                CTable newDB = actualView.GetDbObject().Clone();
                vw.SetDbObject(newDB);
                vw.NotifyAllPropertiesChanged();
                radUp.IsChecked   = vw.UpSelected;
                radDown.IsChecked = vw.DownSelected;
            }
            else
            {
                vw.DownSelected   = true;
                radDown.IsChecked = true;
            }

            vw.IsModified = false;

            CUtil.EnableForm(true, this);
        }
예제 #2
0
        private void cmdAction_Click(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            currentViewObj         = (MInventoryTransaction)btn.Tag;
            btn.ContextMenu.IsOpen = true;
        }
예제 #3
0
 private void lsvImportItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (lsvImportItem.SelectedItems.Count == 1)
     {
         currentViewObj = (MInventoryTransaction)lsvImportItem.SelectedItems[0];
         ShowEditWindow();
     }
 }
예제 #4
0
        protected override MBaseModel createObject()
        {
            mv = new MInventoryTransaction(new CTable(""));
            mv.CreateDefaultValue();

            mv.TxType          = "E";
            mv.ReturnedAllFlag = "N";
            if (dt == InventoryDocumentType.InvDocReturn)
            {
                mv.TxType = "I";
            }

            return(mv);
        }
예제 #5
0
        private void createInfoEntries()
        {
            AddInfoControl(new CCriteriaEntry(CriteriaEntryType.ENTRY_LABEL, "", "from_location"));
            AddInfoControl(new CCriteriaEntry(CriteriaEntryType.ENTRY_TEXT_BOX, "LocationToName", ""));

            MInventoryTransaction m = (MInventoryTransaction)model;
            MInventoryDoc         d = (MInventoryDoc)GetDefaultData();

            if (d != null)
            {
                m.LocationID      = d.ToLocation;
                m.LocationToName  = d.ToLocationName;
                m.ReturnedAllFlag = "N";
            }
        }
예제 #6
0
        public override CReportDataProcessingProperty DataToProcessingProperty(CTable o, ArrayList rows, int row)
        {
            int rowcount = rows.Count;

            CReportDataProcessingProperty rpp = new CReportDataProcessingProperty();

            CRow r  = (CRow)rowdef["DATA_LEVEL1"];
            CRow nr = r.Clone();

            CRow ft  = (CRow)rowdef["FOOTER_LEVEL1"];
            CRow ftr = ft.Clone();

            MInventoryTransaction v = new MInventoryTransaction(o);

            double newh = AvailableSpace - nr.GetHeight();

            if (Parameter.GetFieldValue("COSTING_TYPE").Equals("MOVE"))
            {
                nr.FillColumnsText((row + 1).ToString(), v.DocumentDateFmt, v.DocumentNo, v.LocationName, v.LocationToName, v.ItemCode, v.ItemNameThai
                                   , CUtil.FormatNumber(v.ItemQuantity, "-"), CUtil.FormatNumber(v.ItemPrice, "-"), CUtil.FormatNumber(v.ItemAmount, "-"));

                totals += CUtil.StringToDouble(v.ItemAmount);
            }
            rpp.AddReportRow(nr);
            if (row == rowcount - 1)
            {
                newh = newh - ftr.GetHeight();
                if (newh > 0)
                {
                    ftr.FillColumnsText("", CLanguage.getValue("total"), "", "", "", "", "", "", "", CUtil.FormatNumber(totals.ToString(), "-"));
                    rpp.AddReportRow(ftr);

                    totals = 0;
                }
            }
            if (newh < 0)
            {
                rpp.IsNewPageRequired = true;
            }
            else
            {
                AvailableSpace = newh;
            }

            return(rpp);
        }
예제 #7
0
        public WinAddEditExportItem(InventoryDocumentType dt)
        {
            DocType = dt;

            vw             = new MInventoryTransaction(new CTable(""));
            vw.LocationObj = this.locationObj;
            vw.CreateDefaultValue();

            vw.TxType = "E";
            if (DocType == InventoryDocumentType.InvDocXfer)
            {
                vw.TxType = "X";
            }

            DataContext = vw;

            InitializeComponent();
        }
예제 #8
0
        public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData()
        {
            CTable tb = model.GetDbObject();

            items = OnixWebServiceAPI.GetListAPI("GetBorrowedItemList", "BORROWED_ITEM_LIST", tb);
            lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned();

            itemSources.Clear();
            int idx = 0;

            foreach (CTable o in items)
            {
                MInventoryTransaction v = new MInventoryTransaction(o);

                v.RowIndex = idx;
                itemSources.Add(v);
                idx++;
            }

            Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources);

            return(tuple);
        }
예제 #9
0
        private void addReturnDocItems(ArrayList items)
        {
            //To prevent the duplication selection
            Hashtable hash = CUtil.ObserableCollectionToHash(mv.TxItems, "BorrowID");

            foreach (MInventoryTransaction ai in items)
            {
                if (hash.ContainsKey(ai.InventoryTxID))
                {
                    continue;
                }

                MInventoryTransaction di = new MInventoryTransaction(new CTable(""));
                di.SetDbObject(ai.GetDbObject().CloneAll());
                di.InventoryTxID    = "";
                di.ExtFlag          = "A";
                di.TxType           = "I";
                di.BorrowID         = ai.InventoryTxID;
                di.BorrowDocumentNo = ai.DocumentNo;
                di.ItemQuantity     = ai.ReturnQuantityNeed;

                mv.AddTxItem(di, dt);
            }
        }
예제 #10
0
 public CInventoryDocItem(MInventoryTransaction di, String lang, MReportConfig cfg)
 {
     rptConfig = cfg;
     mi        = di;
     Lang      = lang;
 }