Esempio n. 1
0
        public async Task <ReturnedSaveFuncInfo> SaveAsync(PeoplesBankAccountBussines item, SqlTransaction tr)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                var cmd = new SqlCommand("sp_People_BankAccount_Save", tr.Connection, tr)
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@guid", item.Guid);
                cmd.Parameters.AddWithValue("@parentGuid", item.ParentGuid);
                cmd.Parameters.AddWithValue("@bankname", item.BankName ?? "");
                cmd.Parameters.AddWithValue("@accountNumber", item.AccountNumber ?? "");
                cmd.Parameters.AddWithValue("@shobe", item.Shobe ?? "");

                await cmd.ExecuteNonQueryAsync();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
        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. 3
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);
            }
        }
Esempio n. 4
0
        private PeoplesBankAccountBussines LoadData(SqlDataReader dr)
        {
            var res = new PeoplesBankAccountBussines();

            try
            {
                res.Guid          = (Guid)dr["Guid"];
                res.BankName      = dr["BankName"].ToString();
                res.AccountNumber = dr["AccountNumber"].ToString();
                res.Shobe         = dr["Shobe"].ToString();
                res.ParentGuid    = (Guid)dr["ParentGuid"];
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }

            return(res);
        }