Пример #1
0
        public bool Find(int AccountID, bool ApprovedOnly)
        {
            Database data = new Database();
            SqlDataReader reader = data.GetAccountInfo(AccountID, ApprovedOnly);
            if (reader.Read())
            {
                this.EmployeeID = (int)reader["intEmployeeID"];
                this.intAccountID = (int)reader["intAccountID"];
                this.AccountName = (string)reader["strAccountName"];
                this.Contact = (string)reader["strContact"];
                this.Phone = (string)reader["strPhone"];
                this.Locations = (int)reader["intLocations"];
                this.ClosedRMR = (Decimal)reader["mnyClosedRMR"];
                this.ClosedRSS = (Decimal)reader["mnyClosedRSS"];
                this.RMR_10 = (Decimal)reader["mnyRMR_10"];
                this.RSS_10 = (Decimal)reader["mnyRSS_10"];
                this.RMR_50 = (Decimal)reader["mnyRMR_50"];
                this.RSS_50 = (Decimal)reader["mnyRSS_50"];
                this.RMR_90 = (Decimal)reader["mnyRMR_90"];
                this.RSS_90 = (Decimal)reader["mnyRSS_90"];
                this.Month = (DateTime)reader["dtmMonth"];
                this.blActive = (bool)reader["bitActive"];

                switch (((string)reader["charStatus"]).Trim())
                {
                    case "P":
                        this.Status = AccountStatus.Pending;
                        break;
                    case "A":
                        this.Status = AccountStatus.Approved;
                        break;
                    case "U":
                        this.Status = AccountStatus.Updated;
                        break;
                }

                data.Close();
                data.Dispose();
                return true;
            }
            data.Close();
            data.Dispose();
            return false;
        }