예제 #1
0
        public bool checkDisableAccount(int userType)
        {
            AdminDAL dal    = new AdminDAL();
            string   detail = (string)dal.getPersonDetails("users.csv", -2, userType)?[0];

            if (detail == null)
            {
                return(true);
            }
            string line = (string)dal.getAccountDetails("account.csv", int.Parse(detail.Split(",")[3]))?[0];

            if ((Account.AccountStatus) int.Parse(line.Split(",")[2]) == Account.AccountStatus.Inactive)
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        public void disableAccount(int PersonID)
        {
            AdminDAL  dal     = new AdminDAL();
            ArrayList details = dal.getPersonDetails("users.csv", -2, PersonID);

            if (details != null && details.Count > 0)
            {
                string  line      = (string)details[0];
                int     accountNo = int.Parse(line.Split(",")[3]);
                string  detail    = (string)dal.getAccountDetails("account.csv", accountNo)[0];
                Account account   = new Account(decimal.Parse(detail.Split(",")[1]),
                                                int.Parse(detail.Split(",")[3]), int.Parse(detail.Split(",")[2]));
                account.ID = int.Parse(detail.Split(",")[0]);
                dal.deleteAccount(account.ID);
                account.Status = Account.AccountStatus.Inactive;
                dal.saveAccount(account);
            }
        }