Пример #1
0
        public static async Task <ReturnedSaveFuncInfo> SaveAsync(PhoneBookBussines cls)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                var obj = new WebPhoneBook()
                {
                    Guid               = cls.Guid,
                    Name               = cls.Name,
                    Modified           = cls.Modified,
                    Status             = cls.Status,
                    HardSerial         = cls.HardSerial,
                    ParentGuid         = cls.ParentGuid,
                    Tell               = cls.Tell,
                    Group              = cls.Group,
                    ServerStatus       = cls.ServerStatus,
                    ServerDeliveryDate = cls.ServerDeliveryDate
                };
                await obj.SaveAsync();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
Пример #2
0
        public async Task SaveAsync()
        {
            try
            {
                var res = await Extentions.PostToApi <PeoplesBussines, WebPeople>(this, Url);

                if (res.ResponseStatus != ResponseStatus.Success)
                {
                    var temp = new TempBussines()
                    {
                        ObjectGuid = Guid,
                        Type       = EnTemp.Peoples
                    };
                    await temp.SaveAsync();

                    return;
                }
                var bu = res.Data;
                if (bu == null)
                {
                    return;
                }
                await TempBussines.UpdateEntityAsync(EnTemp.Peoples, bu.Guid, ServerStatus.Delivered, DateTime.Now);

                await WebPhoneBook.SaveAsync(TellList);
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }