Пример #1
0
        private void LoadData()
        {
            isInLoadData = true;

            dtFromDate.Focus();

            vw.CreateDefaultValue();

            CUtil.EnableForm(false, this);

            if (Mode.Equals("E"))
            {
                CTable m = getDocInfoWrapper();
                if (m != null)
                {
                    vw.SetDbObject(m);
                    vw.InitAccountDocPayment();
                    vw.InitAccountDocDeposit();
                    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.VAT_PCT                = CGlobalVariable.GetGlobalVariableValue("VAT_PERCENTAGE");;
                vw.AllowCashNegative      = CGlobalVariable.IsCashNegativeAllow();
                vw.AllowARAPNegative      = CGlobalVariable.IsArApNegativeAllow();
                vw.AllowInventoryNegative = CGlobalVariable.IsInventoryNegativeAllow();
            }

            vw.IsModified = false;
            isInLoadData  = false;

            CUtil.EnableForm(true, this);
        }