Пример #1
0
        public void Update(AdvertisingVM model, EventHandler <RestClientEventArgs <AdvertisingVM> > callback)
        {
            string          relativeUrl = "ExternalSYSService/Advertising/Update";
            AdvertisingInfo msg         = model.ConvertVM <AdvertisingVM, AdvertisingInfo>();

            restClient.Update <AdvertisingInfo>(relativeUrl, msg, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                var vm = args.Result.Convert <AdvertisingInfo, AdvertisingVM>();
                RestClientEventArgs <AdvertisingVM> e = new RestClientEventArgs <AdvertisingVM>(vm, restClient.Page);
                callback(obj, e);
            });
        }
Пример #2
0
        public void Create(AdvertisingVM model, EventHandler <RestClientEventArgs <int?> > callback)
        {
            string          relativeUrl = "ExternalSYSService/Advertising/Create";
            AdvertisingInfo msg         = model.ConvertVM <AdvertisingVM, AdvertisingInfo>();

            msg.CompanyCode = CPApplication.Current.CompanyCode;
            restClient.Create <int?>(relativeUrl, msg, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                model.SysNo = args.Result;
                callback(obj, args);
            });
        }