Ejemplo n.º 1
0
        //private Boolean isOK = false;
        //private Boolean isInLoadData = false;

        public WinLogImport(String mode, ObservableCollection <MBaseModel> parentSources, MLogImportIssue data, String caption)
        {
            Mode = mode;
            parentItemsSource = parentSources;
            actualView        = data;
            Caption           = caption;

            vw          = new MLogImportIssue(new CTable(""));
            DataContext = vw;

            //dtImportDate.IsDropDownOpen = false;

            InitializeComponent();
        }
        public WinAddEditAccountSaleDoc(String md, AccountDocumentType docType, ObservableCollection <MBaseModel> pItems, MLogImportIssue actView)
        {
            dt = docType;

            isBillCorrection = true;
            logImportIssue   = actView;
            Mode             = md;

            CTable o = new CTable("");

            o.SetFieldValue("LOG_IMPORT_ISSUE_ID", logImportIssue.LogImportIssueID);

            vw = new MAccountDoc(o);
            vw.DocumentType = ((int)dt).ToString();
            DataContext     = vw;

            InitializeComponent();
        }
        public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData()
        {
            items = OnixWebServiceAPI.GetLogImportIssueList(model.GetDbObject());
            lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned();

            itemSources.Clear();
            int idx = 0;

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

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

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

            return(tuple);
        }
        private void mnuContextMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu  = (sender as MenuItem);
            string   name = mnu.Name;

            if (name.Equals("mnuEdit"))
            {
                showEditWindow();
            }
            else if (name.Equals("mnuCorrection"))
            {
                MLogImportIssue v    = (MLogImportIssue)currentObj;
                int             type = CUtil.StringToInt(v.DocumentType);

                String caption = "";

                if (type == (int)AccountDocumentType.AcctDocCashSale)
                {
                    caption = CLanguage.getValue("sale_cash_saling");
                    if (!CHelper.VerifyAccessRight("SALE_CSHSALE_ADD"))
                    {
                        return;
                    }
                }
                else if (type == (int)AccountDocumentType.AcctDocDebtSale)
                {
                    caption = CLanguage.getValue("sale_debt_saling");
                    if (!CHelper.VerifyAccessRight("SALE_DBTSALE_MENU"))
                    {
                        return;
                    }
                }

                WinAddEditAccountSaleDoc w = new WinAddEditAccountSaleDoc("E", (AccountDocumentType)type, null, v);
                w.Caption = CLanguage.getValue("bill_correction") + " " + caption;
                w.ShowDialog();
            }
        }