protected override MBaseModel createObject()
        {
            MVStockCostDocument mv = new MVStockCostDocument(new CTable(""));

            mv.DocumentStatus = "1";

            return(mv);
        }
        protected override bool isEditable()
        {
            MVStockCostDocument mv = (MVStockCostDocument)loadParam.ActualView;

            if (mv != null)
            {
                return(mv.IsEditable);
            }

            return(true);
        }
        private void CmdApprove_Click(object sender, RoutedEventArgs e)
        {
            MVStockCostDocument mv = (MVStockCostDocument)vw;

            Boolean r = approveData();

            if (r)
            {
                vw.IsModified = false;
                this.Close();
            }
        }
        public void ShowEditWindowEx(MVStockCostDocument actDoc)
        {
            if (!CHelper.VerifyAccessRight("PURCHASE_COST_EDIT"))
            {
                return;
            }

            CWinLoadParam param = new CWinLoadParam();

            param.Caption    = CLanguage.getValue("ap_stock_cost");
            param.Mode       = "E";
            param.ActualView = actDoc;
            FactoryWindow.ShowWindow("WinAddEditCostDocument", param);
        }
        public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData()
        {
            MVStockCostDocument ad = (model as MVStockCostDocument);
            CTable tb = ad.GetDbObject();

            items = OnixWebServiceAPI.GetListAPI("GetCostDocumentList", "COST_DOC_LIST", tb);
            lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned();

            itemSources.Clear();
            int idx = 0;

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

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

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

            return(tuple);
        }
        private void constructObject()
        {
            MVStockCostDocument mv = (MVStockCostDocument)vw;

            mv.constructTableObject();
        }