コード例 #1
0
ファイル: WebSanad.cs プロジェクト: Majidkhackpour/RealState
        public async Task SaveAsync()
        {
            try
            {
                var res = await Extentions.PostToApi <SanadBussines, WebSanad>(this, Url);

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

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

                await WebSanadDetail.SaveAsync(DetList);
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
コード例 #2
0
        public static async Task <ReturnedSaveFuncInfo> SaveAsync(SanadDetailBussines cls)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                var obj = new WebSanadDetail()
                {
                    Guid               = cls.Guid,
                    Modified           = cls.Modified,
                    HardSerial         = cls.HardSerial,
                    ServerStatus       = cls.ServerStatus,
                    ServerDeliveryDate = cls.ServerDeliveryDate,
                    Description        = cls.Description,
                    Debit              = cls.Debit,
                    Credit             = cls.Credit,
                    TafsilGuid         = cls.TafsilGuid,
                    MoeinGuid          = cls.MoeinGuid,
                    MasterGuid         = cls.MasterGuid
                };
                await obj.SaveAsync();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }