Beispiel #1
0
        public User(decimal ID, bool AsProxy)
        {
            if (AsProxy == false)
            {
                FI.DataAccess.Users        dacObj = DataAccessFactory.Instance.GetUsersDA();
                FI.Common.Data.FIDataTable table  = dacObj.ReadUser(ID);
                if (table == null || table.Rows.Count == 0)
                {
                    throw new Exception("Cannot authenticate by id:" + ID.ToString());
                }

                LoadData(table);

                this._isProxy = false;
            }

            this._id = ID;

            if (this.IsNew == false)
            {
                _contactSystem      = new ContactSystem(this);
                _reportSystem       = new ReportSystem(this);
                _distributionSystem = new DistributionSystem(this);               // after Contacts and Reports
            }
        }
Beispiel #2
0
        public User(string CompanyNameShort, string Logon, string Password)
        {
            FI.Common.DataAccess.IUsersDA dacObj=DataAccessFactory.Instance.GetUsersDA();

            // read
            FI.Common.Data.FIDataTable table=dacObj.ReadUser(CompanyNameShort , Logon, Password);
            if(table.Rows.Count==0)
                throw new Exception("Incorrect login information");

            System.Data.DataRow row=table.Rows[0];
            this._id=(decimal)row["id"];
            LoadData(table);

            this._isProxy=false;

            _contactSystem=new ContactSystem(this);
            _reportSystem=new ReportSystem(this);
            _distributionSystem=new DistributionSystem(this); // after Contacts and Reports
        }
Beispiel #3
0
        public User(string CompanyNameShort, string Logon, string Password)
        {
            FI.DataAccess.Users dacObj = DataAccessFactory.Instance.GetUsersDA();

            // read
            FI.Common.Data.FIDataTable table = dacObj.ReadUser(CompanyNameShort, Logon, Password);
            if (table.Rows.Count == 0)
            {
                throw new Exception("Incorrect login information");
            }

            System.Data.DataRow row = table.Rows[0];
            this._id = (decimal)row["id"];
            LoadData(table);


            this._isProxy = false;

            _contactSystem      = new ContactSystem(this);
            _reportSystem       = new ReportSystem(this);
            _distributionSystem = new DistributionSystem(this);           // after Contacts and Reports
        }
Beispiel #4
0
        public User(decimal ID , bool AsProxy)
        {
            if(AsProxy==false)
            {
                FI.Common.DataAccess.IUsersDA dacObj=DataAccessFactory.Instance.GetUsersDA();
                FI.Common.Data.FIDataTable table=dacObj.ReadUser(ID);
                if(table==null || table.Rows.Count==0)
                    throw new Exception("Cannot authenticate by id:" + ID.ToString());

                LoadData(table);

                this._isProxy=false;
            }

            this._id=ID;

            if(this.IsNew==false)
            {
                _contactSystem=new ContactSystem(this);
                _reportSystem=new ReportSystem(this);
                _distributionSystem=new DistributionSystem(this); // after Contacts and Reports
            }
        }