Пример #1
0
        private async Task <ReturnedSaveFuncInfo> SaveMobileAsync(SqlTransaction tr)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                res.AddReturnedValue(await PhoneBookBussines.RemoveAsync(Guid, tr));
                if (res.HasError)
                {
                    return(res);
                }

                foreach (var item in TellList)
                {
                    item.ParentGuid = Guid;
                    item.Name       = Name;
                }

                res.AddReturnedValue(await PhoneBookBussines.SaveRangeAsync(TellList, tr));
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
Пример #2
0
        private async Task <ReturnedSaveFuncInfo> SaveMobileAsync(SqlTransaction tr)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                res.AddReturnedValue(await PhoneBookBussines.RemoveAsync(Guid, tr));
                if (res.HasError)
                {
                    return(res);
                }

                var tellList = new List <PhoneBookBussines>();
                if (!string.IsNullOrEmpty(Mobile1))
                {
                    var mob1 = new PhoneBookBussines()
                    {
                        Guid       = Guid.NewGuid(),
                        Modified   = DateTime.Now,
                        Status     = true,
                        Name       = Name,
                        ParentGuid = Guid,
                        Tell       = Mobile1,
                        Group      = EnPhoneBookGroup.Advisor
                    };
                    tellList.Add(mob1);
                }
                if (!string.IsNullOrEmpty(Mobile2))
                {
                    var mob1 = new PhoneBookBussines()
                    {
                        Guid       = Guid.NewGuid(),
                        Modified   = DateTime.Now,
                        Status     = true,
                        Name       = Name,
                        ParentGuid = Guid,
                        Tell       = Mobile2,
                        Group      = EnPhoneBookGroup.Advisor
                    };
                    tellList.Add(mob1);
                }
                res.AddReturnedValue(await PhoneBookBussines.SaveRangeAsync(tellList, tr));
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }