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);
        }
        private AdvisorBussines LoadData(SqlDataReader dr)
        {
            var item = new AdvisorBussines();

            try
            {
                item.Guid               = (Guid)dr["Guid"];
                item.Modified           = (DateTime)dr["Modified"];
                item.Status             = (bool)dr["Status"];
                item.Name               = dr["Name"].ToString();
                item.Account            = (decimal)dr["Account"];
                item.AccountFirst       = (decimal)dr["AccountFirst"];
                item.Address            = dr["Address"].ToString();
                item.ServerDeliveryDate = (DateTime)dr["ServerDeliveryDate"];
                item.ServerStatus       = (ServerStatus)dr["ServerStatus"];
                var tellList = PhoneBookBussines.GetAll(item.Guid, true);
                if (tellList?.Count == 1)
                {
                    item.Mobile1 = tellList[0]?.Tell;
                }
                if (tellList?.Count > 1)
                {
                    item.Mobile1 = tellList[0]?.Tell;
                    item.Mobile2 = tellList[1]?.Tell;
                }
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }

            return(item);
        }
示例#3
0
        public frmSendSms(List <Guid> lstGuid, string text)
        {
            InitializeComponent();
            ucHeader.Text   = "ارسال پیامک";
            txtMessage.Text = text;
            var lstNumbers = new List <string>();

            foreach (var guid in lstGuid)
            {
                var numbers = PhoneBookBussines.GetAll(guid, true);
                if (numbers.Count <= 0)
                {
                    continue;
                }
                lstNumbers = numbers.Where(q => q.Tell.StartsWith("09") && q.Tell.Length > 10).Select(q => q.Tell)
                             .ToList();
            }
            AddItems(lstNumbers);
        }