Exemple #1
0
        //private Boolean isInLoadData = false;

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

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

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

            itemSources.Clear();
            int idx = 0;

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

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

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

            return(tuple);
        }
Exemple #3
0
        private Boolean ValidateData()
        {
            Boolean result = false;

            result = CHelper.ValidateComboBox(lblBranch, cboBranch, false);
            if (!result)
            {
                return(result);
            }


            result = CHelper.ValidateTextBox(lblKey, txtKey, false);
            if (!result)
            {
                return(result);
            }

            result = CHelper.ValidateTextBox(lblVoidBill, txtVoidBill, false);
            if (!result)
            {
                return(result);
            }

            #region CashDocVat
            result = CHelper.ValidateTextBox(lblSaleByCashDocVat, txtSaleByCashDocVatPrefix, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblSaleByCashDocVat, txtSaleByCashDocVatPattern, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblCashVatLen, txtCashVatLen, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblCashVatOffset, txtCashVatOffset, false);
            if (!result)
            {
                return(result);
            }
            #endregion

            #region DebtDocVat
            result = CHelper.ValidateTextBox(lblSaleByDebtDocVat, txtSaleByDebtDocVatPrefix, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblSaleByDebtDocVat, txtSaleByDebtDocVatPattern, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblDebtVatLen, txtDebtVatLen, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblDebtVatOffset, txtDebtVatOffset, false);
            if (!result)
            {
                return(result);
            }
            #endregion

            #region CashDocNV
            result = CHelper.ValidateTextBox(lblSaleByCashDocNV, txtSaleByCashDocNVPrefix, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblSaleByCashDocNV, txtSaleByCashDocNVPattern, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblCashNoVatLen, txtCashNoVatLen, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblCashNoVatOffset, txtCashNoVatOffset, false);
            if (!result)
            {
                return(result);
            }
            #endregion

            #region DebtDocNV
            result = CHelper.ValidateTextBox(lblSaleByDebtDocNV, txtSaleByDebtDocNVPrefix, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblSaleByDebtDocNV, txtSaleByDebtDocNVPattern, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblDebtNoVatLen, txtDebtNoVatLen, false);
            if (!result)
            {
                return(result);
            }
            result = CHelper.ValidateTextBox(lblDebtNoVatOffset, txtDebtNoVatOffset, false);
            if (!result)
            {
                return(result);
            }
            #endregion

            result = CHelper.ValidateComboBox(lblLocationVat, cboLocationVat, false);
            if (!result)
            {
                return(result);
            }

            result = CHelper.ValidateComboBox(lblAccountVat, cboAccountVat, false);
            if (!result)
            {
                return(result);
            }

            result = CHelper.ValidateComboBox(lblLocationNoVat, cboLocationNoVat, false);
            if (!result)
            {
                return(result);
            }

            result = CHelper.ValidateComboBox(lblAccountNoVat, cboAccountNoVat, false);
            if (!result)
            {
                return(result);
            }

            CTable ug = new CTable("");
            MBranchConfigCenter uv = new MBranchConfigCenter(ug);
            uv.BranchID = vw.BranchID;
            uv.Key      = vw.Key;
            if (!vw.BranchConfigID.Equals(""))
            {
                uv.BranchConfigID = vw.BranchConfigID;
            }

            if (OnixWebServiceAPI.IsBranchConfigExist(uv.GetDbObject()))
            {
                //String ss = ((cboBranch as ComboBox).SelectedValue as MMasterRef).MasterID as string;
                CHelper.ShowKeyExist(lblBranch, cboBranch);
                return(false);
            }


            return(result);
        }