private PeoplesBussines LoadData(SqlDataReader dr)
        {
            var item = new PeoplesBussines();

            try
            {
                item.Guid               = (Guid)dr["Guid"];
                item.Modified           = (DateTime)dr["Modified"];
                item.Status             = (bool)dr["Status"];
                item.Name               = dr["Name"].ToString();
                item.Code               = dr["Code"].ToString();
                item.Account            = (decimal)dr["Account"];
                item.AccountFirst       = (decimal)dr["AccountFirst"];
                item.NationalCode       = dr["NationalCode"].ToString();
                item.IdCode             = dr["IdCode"].ToString();
                item.FatherName         = dr["FatherName"].ToString();
                item.PlaceBirth         = dr["PlaceBirth"].ToString();
                item.DateBirth          = dr["DateBirth"].ToString();
                item.Address            = dr["Address"].ToString();
                item.IssuedFrom         = dr["IssuedFrom"].ToString();
                item.PostalCode         = dr["PostalCode"].ToString();
                item.GroupGuid          = (Guid)dr["GroupGuid"];
                item.ServerDeliveryDate = (DateTime)dr["ServerDeliveryDate"];
                item.ServerStatus       = (ServerStatus)dr["ServerStatus"];
                item.IsModified         = true;
                item.BankList           = AsyncContext.Run(() => PeoplesBankAccountBussines.GetAllAsync(item.Guid));
                item.TellList           = PhoneBookBussines.GetAll(item.Guid, true);
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }

            return(item);
        }
Esempio n. 2
0
        private async Task LoadDataAsync(Guid parentGuid, string search = "")
        {
            try
            {
                var list = await PeoplesBankAccountBussines.GetAllAsync(parentGuid, search);

                peoplesAccountBindingSourcr.DataSource = list.ToSortableBindingList();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }