Exemple #1
0
        private void LoadData()
        {
            isInLoadData = true;

            this.Title = Caption;
            dtFromDate.Focus();

            vw.CreateDefaultValue();

            CUtil.EnableForm(false, this);

            if (Mode.Equals("E"))
            {
                CTable m = getDocInfoWrapper();
                if (m != null)
                {
                    vw.SetDbObject(m);
                    vw.InitAuxilaryDocItem();
                    vw.InitPaymentCriteria();

                    String tmp = vw.EntityAddressID;
                    vw.InitEntityAddresses();
                    vw.EntityAddressID = tmp;

                    tmp = vw.EntityBankAccountID;
                    vw.InitEntityBankAccounts();
                    vw.EntityBankAccountID = tmp;

                    vw.AddressObj = CUtil.MasterIDToObject(vw.EntityAddresses, vw.EntityAddressID);

                    vw.NotifyAllPropertiesChanged();
                }
            }
            else if (Mode.Equals("A"))
            {
                vw.DocumentDate = DateTime.Now;
                vw.VatPct       = CGlobalVariable.GetGlobalVariableValue("VAT_PERCENTAGE");
                vw.VatType      = CGlobalVariable.GetGlobalVariableValue("DEFAULT_VAT_TYPE_PERCHASE");
                vw.NoteWidthCm  = "10.00";
                vw.NoteHeightCm = "7.00";
                vw.NoteTopCm    = "12.00";
                vw.NoteLeftCm   = "1.00";
                vw.IsNoteStick  = false;

                ObservableCollection <MMasterRef> branches = CMasterReference.Instance.Branches;
                if (branches.Count > 1)
                {
                    MMasterRef b = branches[1];
                    cboBranch.SelectedObject = b;
                }

                vw.IsPoInvoiceRefByItem = true;
            }

            vw.IsModified = false;
            isInLoadData  = false;

            CUtil.EnableForm(true, this);
        }
        private void LoadData()
        {
            isInLoadData = true;

            this.Title = Caption;
            dtFromDate.Focus();

            vw.CreateDefaultValue();

            CUtil.EnableForm(false, this);

            if (Mode.Equals("E"))
            {
                CTable m = getDocInfoWrapper();
                if (m != null)
                {
                    vw.SetDbObject(m);
                    vw.InitAuxilaryDocItem();
                    vw.InitRemarks();
                    quotationType = vw.QuotationType;

                    String tmp = vw.EntityAddressID;
                    vw.InitEntityAddresses();
                    vw.EntityAddressID = tmp;

                    vw.AddressObj = CUtil.MasterIDToObject(vw.EntityAddresses, vw.EntityAddressID);

                    vw.NotifyAllPropertiesChanged();
                }
            }
            else if (Mode.Equals("A"))
            {
                vw.DocumentDate = DateTime.Now;
                vw.VatPct       = CGlobalVariable.GetGlobalVariableValue("VAT_PERCENTAGE");
                vw.VatType      = CGlobalVariable.GetGlobalVariableValue("DEFAULT_VAT_TYPE_PERCHASE");
            }

            vw.IsModified = false;
            isInLoadData  = false;

            CUtil.EnableForm(true, this);
        }