Exemplo n.º 1
0
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx).
            SystemUsers usr = null;

            if (!GeneralValues.IsNetCore)
            {
                usr = Session.GetObjectByKey <SystemUsers>(SecuritySystem.CurrentUserId);
            }
            else
            {
                usr = Session.FindObject <SystemUsers>(CriteriaOperator.Parse("UserName=?", GeneralValues.NetCoreUserName));
            }
            if (usr != null && usr.Company != null)
            {
                Company = Session.GetObjectByKey <Company>(usr.Company.Oid);
            }
            PostToDocument = PostToDocument.Document;

            DocTypeSeriesDoc doc = new DocTypeSeriesDoc(Session);

            doc.NextDocNo = 1000001;
            Prefix        = "";
            this.DetailBO.Add(doc);
        }
Exemplo n.º 2
0
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx).

            BoCode      = "";
            BoName      = "";
            IsOverride  = false;
            IsActive    = false;
            IsReject    = false;
            ApprovalCnt = 1;

            DocAmount = 0;
            SystemUsers usr = null;

            if (!GeneralValues.IsNetCore)
            {
                usr = Session.GetObjectByKey <SystemUsers>(SecuritySystem.CurrentUserId);
            }
            else
            {
                usr = Session.FindObject <SystemUsers>(CriteriaOperator.Parse("UserName=?", GeneralValues.NetCoreUserName));
            }
            if (usr != null && usr.Company != null)
            {
                Company    = Session.FindObject <Company>(new BinaryOperator("BoCode", usr.Company.BoCode, BinaryOperatorType.Equal));
                AppType    = Company.AppType;
                ApprovalBy = Company.ApprovalBy;
                DocCur     = Session.FindObject <vwCurrency>(CriteriaOperator.Parse("CompanyCode=? and CurrCode=?", Company.BoCode, Company.LocalCurreny));
            }
        }
Exemplo n.º 3
0
        protected override void OnLoaded()
        {
            base.OnLoaded();

            if (!GeneralValues.IsNetCore)
            {
                if (!string.IsNullOrEmpty(SecuritySystem.CurrentUserId.ToString()))
                {
                    SystemUsers user = Session.GetObjectByKey <SystemUsers>(SecuritySystem.CurrentUserId);
                    if (user != null)
                    {
                        this.IsViewItemPriceRole = CreateUser.CheckAccessVP(ObjType.BoCode);
                    }
                }
            }
        }
Exemplo n.º 4
0
 protected override void OnSaved()
 {
     base.OnSaved();
     if (!(Session is NestedUnitOfWork) &&
         (Session.DataLayer != null) &&
         (Session.ObjectLayer is SimpleObjectLayer)
         )
     {
         if (!GeneralValues.IsNetCore)
         {
             SystemUsers user = Session.GetObjectByKey <SystemUsers>(SecuritySystem.CurrentUserId);
             Session.ExecuteSproc("sp_AfterDocUpdated", new OperandValue(user.UserName), new OperandValue(this.Oid), new OperandValue(this.DocType.BoCode));
         }
         else
         {
             Session.ExecuteSproc("sp_AfterDocUpdated", new OperandValue(GeneralValues.NetCoreUserName), new OperandValue(this.Oid), new OperandValue(this.DocType.BoCode));
         }
     }
 }
Exemplo n.º 5
0
        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx).
            SystemUsers usr = null;

            if (!GeneralValues.IsNetCore)
            {
                usr = Session.GetObjectByKey <SystemUsers>(SecuritySystem.CurrentUserId);
            }
            else
            {
                usr = Session.FindObject <SystemUsers>(CriteriaOperator.Parse("UserName=?", GeneralValues.NetCoreUserName));
            }
            if (usr != null && usr.Company != null)
            {
                Company = Session.FindObject <Company>(new BinaryOperator("BoCode", usr.Company.BoCode, BinaryOperatorType.Equal));
            }
        }