Exemple #1
0
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            base.OnActionExecuted(actionExecutedContext);

            if (actionExecutedContext.ActionContext.Response != null)
            {
                HeaderModel responseHeader = new HeaderModel().ResponseHeader(HeaderUtilityModel.GetHeaders(actionExecutedContext.Request.Headers));
                actionExecutedContext.ActionContext.Response.Headers.Add("API-CreationTimeStamp", responseHeader.CreationTimeStamp ==
                                                                         DateTime.MinValue ? null : responseHeader.CreationTimeStamp.ToString("yyyy-MM-ddTHH:mm:ss.fffK"));

                actionExecutedContext.ActionContext.Response.Headers.Add("API-SenderHostName", responseHeader.SenderHostName);
                actionExecutedContext.ActionContext.Response.Headers.Add("API-SenderMessageIdEcho", responseHeader.SenderMessageIdEcho);
                actionExecutedContext.ActionContext.Response.Headers.Add("API-SenderMessageId", responseHeader.SenderMessageId);
                actionExecutedContext.ActionContext.Response.Headers.Add("API-SenderApplicationId", responseHeader.SenderApplicationId);
                actionExecutedContext.ActionContext.Response.Headers.Add("API-TransactionId", responseHeader.TransactionId);
                actionExecutedContext.ActionContext.Response.Headers.Add("API-OriginationApplicationId", responseHeader.OriginationApplicationId);

                string actionName     = actionExecutedContext.ActionContext.ActionDescriptor.ActionName;
                string controllerName = actionExecutedContext.ActionContext.ActionDescriptor.ControllerDescriptor.ControllerName;

                string stream = string.Empty;
                try
                {
                    if (actionExecutedContext.Response.Content != null)
                    {
                        var responseBody = actionExecutedContext.Response.Content.ReadAsStringAsync();
                        stream = responseBody.Result;
                    }

                    //// Log response to DB or certerlize logging location
                }
                catch {}
            }
        }
 public HeaderViewModel()
 {
     headerModel = new HeaderModel()
     {
         ImageUrl = new Uri(@"Resources\Images\logo.jpg", UriKind.Relative), AppTitle = "Trading Simulation"
     };
 }
Exemple #3
0
        //解析Rule数据
        private static ArrayList parseRuleData(JArray rules, int parentIndex, string type)
        {
            ArrayList result = new ArrayList();

            for (int i = 0, len = rules.Count; i < len; i++)
            {
                JObject rule = rules[i] as JObject;
                if (type == "host")
                {
                    HostModel temp = new HostModel(parentIndex, i, (bool)rule["enable"], rule["ip"].ToString(), rule["port"].ToString(), rule["url"].ToString());
                    result.Add(temp);
                }
                else if (type == "file")
                {
                    FileModel temp = new FileModel(parentIndex, i, (bool)rule["enable"], rule["url"].ToString(), rule["path"].ToString());
                    result.Add(temp);
                }
                else if (type == "https")
                {
                    HttpsModel temp = new HttpsModel(parentIndex, i, (bool)rule["enable"], rule["url"].ToString());
                    result.Add(temp);
                }
                else if (type == "header")
                {
                    HeaderModel temp = new HeaderModel(parentIndex, i, (bool)rule["enable"], rule["type"].ToString(), rule["url"].ToString(), rule["key"].ToString(), rule["value"].ToString());
                    result.Add(temp);
                }
            }

            return(result);
        }
        public RegisterStepThreePage(UserRegistrationRequest objUserRegistrationRequest, RetailerList objRetailerList)
        {
            InitializeComponent();
            NavigationPage.SetBackButtonTitle(this, "");
            XFLblTAC.Text    = $"T&C";
            _objRetailerList = new RetailerList();
            if (objRetailerList != null)
            {
                _objRetailerList = objRetailerList;

                imgCompanyLogo.Source   = objRetailerList.imagePath;
                XFLBLCompanyRate.Text   = $"{objRetailerList.rate:0.00}" + "c";
                XFBTN_Duration.Text     = objRetailerList.duration + " Months";
                xflblnoAccounttext.Text = "Haven't started electric service at this address yet? Call " + objRetailerList.retailerName + "at " + objRetailerList.phoneNumber + " and set up an account for this address. Then enter the 20-digit number to complete your order.";
            }

            _objUserRegistrationRequest = new UserRegistrationRequest();
            _objUserRegistrationRequest = objUserRegistrationRequest;

            this.BindingContext = _objUserRegistrationRequest;

            _objUserRegistrationResponse = new UserRegistrationResponse();

            _apiService     = new RestApi();
            _baseUrl        = Domain.Url + Domain.UserSignUpApiConstant;
            _objHeaderModel = new HeaderModel();
        }
Exemple #5
0
        // GET: SiteLayout
        public ActionResult RenderHeader()
        {
            var homenode   = Services.ContentService.GetById(getHomeNode(CurrentPage));
            var menuP      = homenode.Children().First(o => o.ContentType.Alias == "principal");
            var menuItemP  = menuP.Children();
            var menupmodel = new List <menuitem>();

            menupmodel.Add(new menuitem()
            {
                titulo = homenode.GetValue <string>("titulo"),
                url    = new UmbracoHelper(UmbracoContext).Url(homenode.Id)
            });
            menuItemP.ToList().ForEach(o => {
                menupmodel.Add(new menuitem()
                {
                    titulo = o.GetValue <string>("titulo"),
                    url    = new UmbracoHelper(UmbracoContext).Url(o.Id)
                });
            });
            var model = new HeaderModel()
            {
                Titulo = homenode.GetValue <string>("titulo")
            };

            model.principal = menupmodel;

            return(PartialView(PARTIALS_HOME_FOLDER + "_header.cshtml", model));
        }
        public async Task Add_Test()
        {
            var header = new HeaderModel
            {
                HeaderName  = "Header",
                HeaderValue = "Value"
            };

            var query = new QueryModel
            {
                InsertDate      = DateTime.Now,
                QueryParamName  = "Param",
                QueryParamValue = "Value"
            };

            query.Headers = new List <HeaderModel>();

            query.Headers.Add(header);

            header.Query = query;

            var target = new HeaderRepository(this.dataContext);

            var result = await target.Add(header);

            Assert.IsNotNull(result);
            Assert.AreNotEqual(0, result.Id);
            Assert.AreNotEqual(0, result.Query.Id);
        }
Exemple #7
0
        public void LoadHeaderTwo()
        {
            //HeaderViewModel = new HeaderNumberTwoViewModel("Header Two", "Experten raten zum Weißanstrich mit einer speziellen Farbe, die in jedem Gartencenter und -fachhandel erhältlich ist. Der helle Farbton reflektiert die Sonnenstrahlen, verhindert so eine zu starke Erwärmung der Rinde und beugt dadurch Spannungsrissen vor, so der Bundesverband Garten-, Landschafts- und Sportplatzbau (BGL). Vor dem Anstrich muss man den Stamm vorsichtig von Moos und Flechten befreien.");
            HeaderModel hm = new HeaderModel();

            hm.Header      = "Header Two Neu";
            hm.Message     = "Experten raten zum Weißanstrich mit einer speziellen Farbe, die in jedem Gartencenter und -fachhandel erhältlich ist";
            hm.Body        = "Body for Model Two";
            hm.BodyMessage = "This is the bodymessage for M2";
            hm.Number      = 26;



            IMapper mapper = AutoMapperHelper.DoMappings();

            var dest = mapper.Map <HeaderModel, HeaderNumberTwoViewModel>(hm);



            BodyViewModel body = mapper.Map <HeaderModel, BodyViewModel>(hm);


            bodyViewModel = body;



            HeaderViewModel = dest;
        }
Exemple #8
0
        public void LoadHeaderOne()
        {
            HeaderModel hm = new HeaderModel();

            hm.Header      = "Header One Neu";
            hm.Message     = "Ganz kurz -   ";
            hm.Body        = "Body";
            hm.BodyMessage = "This is the bodymessage";
            hm.Number      = 4;



            IMapper mapper = AutoMapperHelper.DoMappings();

            var dest = mapper.Map <HeaderModel, HeaderNumberOneViewModel>(hm);



            BodyViewModel body = mapper.Map <HeaderModel, BodyViewModel>(hm);


            bodyViewModel = body;



            HeaderViewModel = dest;
        }
        public HeaderModel GetHeaderModel()
        {
            HeaderModel ret = new HeaderModel();

            ret.HeaderId                = this.HeaderId;
            ret.Category                = this.Category;
            ret.ValidatorName           = this.ValidatorName;
            ret.IssuerName              = this.IssuerName;
            ret.RecipientName           = this.RecipientName;
            ret.IssuerUuid              = this.IssuerUuid;
            ret.ValidatorUuid           = this.ValidatorUuid;
            ret.ValidatorLegitimationId = this.ValidatorLegitimationId;
            ret.RecipientUuid           = this.RecipientUuid;
            ret.PreviousHeaderId        = this.PreviousHeaderId;
            ret.NextHeaderId            = this.NextHeaderId;
            ret.Timestamp               = Utils.Convert.ToTimestamp(this.Timestamp);
            ret.BlockNumber             = this.BlockNumber;
            ret.DataAddress             = this.DataAddress;
            ret.ValidationExpiry        = this.ValidationExpiry;
            ret.ValidationCounter       = this.ValidationCounter;
            ret.DataHash                = this.DataHash;
            ret.Nonce      = Utils.Convert.ToBytesString(this.Nonce);
            ret.Stored     = !String.IsNullOrEmpty(this.Link);
            ret.Attachment = this.Attachment;
            ret.GlobalHash = this.GlobalHash;

            return(ret);
        }
        public List <HeaderModel> GetFullHeaderList(DateTime startDate, DateTime endDate, int availableWidth, Font timeFont)
        {
            var headerList = new List <HeaderModel>();

            var timeInterval = endDate - startDate;

            var headerSpace = System.Windows.Forms.TextRenderer.MeasureText("12-12-12", timeFont);

            var numberOfHeaders = availableWidth / headerSpace.Width;

            var timeIncrement = new TimeSpan(timeInterval.Ticks / numberOfHeaders);

            var index = 0;

            for (var date = startDate; date <= endDate; date = date.Add(timeIncrement), index++)
            {
                var header = new HeaderModel
                {
                    HeaderDateTime = date,
                    StartLocation  = ChartConstants.BarStartLeft + (index * headerSpace.Width)
                };

                headerList.Add(header);
            }

            return(headerList);
        }
Exemple #11
0
        public WorkOutListingPage()
        {
            InitializeComponent();
            filtersList = new ObservableCollection <FilterUser>();
            filtersList.Add(new FilterUser {
                ListId = 1, ListName = "Current week (Monday to Sunday)"
            });
            filtersList.Add(new FilterUser {
                ListId = 2, ListName = "Current week(Sunday to Saturday)"
            });
            filtersList.Add(new FilterUser {
                ListId = 3, ListName = "Next seven days"
            });
            filtersList.Add(new FilterUser {
                ListId = 4, ListName = "Previous seven days"
            });
            _objExerciseListingResponse = new ExerciseListingResponse();
            _apiService     = new RestApi();
            _baseUrl        = Settings.Url + Domain.ListofWorkoutApiConstant;
            _objHeaderModel = new HeaderModel();
            XFDDWorkoutFilter.ItemsSource   = filtersList;
            XFDDWorkoutFilter.SelectedIndex = 0;
            Search = "Current week (Monday to Sunday)";
            //LoadWorkoutListData();
            //for(int i = 0; i <= 10; i++)
            //{
            //    objList.Add("a");
            //}

            //WorkoutList.ItemsSource = objList;
        }
Exemple #12
0
        public ActionResult Header()
        {
            var model = new HeaderModel();

            model.IsLoggedIn = _workContext.IsLoggedIn;
            return(PartialView(model));
        }
 private void Discard_Changes(object sender, EventArgs e)
 {
     _objAddWorkoutScheduleRequest  = new AddWorkoutScheduleRequest();
     _objAddWorkoutScheduleResponse = new AddWorkoutScheduleResponse();
     _apiService        = new RestApi();
     _objHeaderModel    = new HeaderModel();
     _baseUrl           = Settings.Url + Domain.AddWorkoutScheduleApiConstant;
     _objRecereenceList = new RecereenceList();
     dropdownReccerenceType.ItemsSource = _objRecereenceList.RecerrenceSource;
     BindingContext                          = _objAddWorkoutScheduleRequest;
     XFEntryTxtFriend.Text                   = "";
     XFEntryTxtMe.Text                       = "";
     XfTPStartTime.Time                      = TimeSpan.Parse("00:00");
     XFBtnMonday.BackgroundColor             = Color.FromHex("#64BAEB");
     IsMondaySelected                        = false;
     _objAddWorkoutScheduleRequest.Monday    = false;
     XFBtnTuesday.BackgroundColor            = Color.FromHex("#64BAEB");
     IsTuesdaySelected                       = false;
     _objAddWorkoutScheduleRequest.Tuesday   = false;
     XFBtnWednesday.BackgroundColor          = Color.FromHex("#64BAEB");
     IsWednesdaySelected                     = false;
     _objAddWorkoutScheduleRequest.Wednesday = false;
     XFBtnThursaday.BackgroundColor          = Color.FromHex("#64BAEB");
     IsThursdaySelected                      = false;
     _objAddWorkoutScheduleRequest.Thursday  = false;
     XFBtnFriday.BackgroundColor             = Color.FromHex("#64BAEB");
     IsFridaySelected                        = false;
     _objAddWorkoutScheduleRequest.Friday    = false;
     XFBtnSaturday.BackgroundColor           = Color.FromHex("#64BAEB");
     IsSaturdaySelected                      = false;
     _objAddWorkoutScheduleRequest.Saturday  = false;
     XFBtnSunday.BackgroundColor             = Color.FromHex("#64BAEB");
     IsSundaySelected                        = false;
     _objAddWorkoutScheduleRequest.Sunday    = false;
 }
Exemple #14
0
        public ActionResult MenuMain()
        {
            //ViewBag.LogoUrl = HeaderModel.GetLogoUrl();
            List <Entities.Page> model = HeaderModel.GeneralMenuMain();

            return(PartialView("../Partial/_MenuMain", model));
        }
Exemple #15
0
        //保存点击事件
        private void addHeaderRule(object sender, MouseButtonEventArgs e)
        {
            string url   = this.url.Text;
            string value = this.value.Text;
            string type  = this._isReq ? "req" : "res";
            string key   = this._key == StaticResourcesTool.headerKeys[0] ? this.customKey.Text : this._key;

            if (type.Length == 0)
            {
                Fiddler.FiddlerApplication.DoNotifyUser("Please input the type", "Error tips");
                return;
            }

            if (url.Length == 0)
            {
                Fiddler.FiddlerApplication.DoNotifyUser("Please input the url", "Error tips");
                return;
            }

            if (key.Length == 0)
            {
                Fiddler.FiddlerApplication.DoNotifyUser("Please input the key", "Error tips");
                return;
            }

            if (value.Length == 0)
            {
                Fiddler.FiddlerApplication.DoNotifyUser("Please input the value", "Error tips");
                return;
            }

            //生产参数
            JObject param = new JObject();

            param["type"]  = type;
            param["url"]   = url;
            param["key"]   = key;
            param["value"] = value;

            if (_index >= 0 && _type != "copy")
            {
                //修改数据
                Main.mainData.modifyRuleByIndex(_parentIndex, _index, param);
            }
            else
            {
                //添加Rule数据
                HeaderModel rule = Main.mainData.addRuleToItem <HeaderModel>(_parentIndex, param);
                //添加UI
                Main.container.addRuleToUI(rule);
                //获取Item数据
                ItemModel item = Main.mainData.getItemByIndex(_parentIndex);
                //显示对应区域
                item.Show = true;
            }

            //关闭弹框
            (this.Parent as Window).Close();
        }
Exemple #16
0
        public void AddHeader(Grid grid)
        {
            HeaderModel     model     = new HeaderModel(1);
            HeaderViewModel viewModel = new HeaderViewModel(model);


            grid.Children.Add(viewModel.SetHeader());
        }
        public PartialViewResult HeaderReklam()
        {
            var model = new HeaderModel();

            model.Slider   = db.Slider.Where(s => s.Aktif == true).ToList();
            model.Haberler = db.Haberler.Where(h => h.Aktif == true).OrderByDescending(h => h.Id).Take(20).ToList();
            return(PartialView("~/Views/_Partial/_headerReklam.cshtml", model));
        }
Exemple #18
0
        public ActionResult Header()
        {
            HeaderModel model = new HeaderModel();

            model.user = "******";

            return(PartialView(model));
        }
Exemple #19
0
 public ResetPINPage()
 {
     InitializeComponent();
     _apiServices = new RestApi();
     _baseUrl     = Settings.Url + Domain.UpdatePINApiConstant;
     _objPINUpdateRequestModel  = new PINUpdateRequestModel();
     _objPINUpdateResponseModel = new PINUpdateResponseModel();
     _objHeaderModel            = new HeaderModel();
 }
Exemple #20
0
 public SubContractor_HomePage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _objSC_HomePageResponse = new SC_HomePageResponse();
     _objHeaderModel         = new HeaderModel();
     _baseUrl     = Settings.Url + Domain.SC_HomeApiConstant;
     _apiServices = new RestApi();
 }
 public LoadSignOffPopUp(int Loadid)
 {
     InitializeComponent();
     LoadID       = Loadid;
     _apiServices = new RestApi();
     _baseUrl     = Settings.Url + Domain.LoadOffC_SignatureApiConstant;
     _objDriver_LoadSignOffResponse = new Driver_LoadSignOffResponse();
     _objHeaderModel = new HeaderModel();
 }
Exemple #22
0
 public Mechanic_HomePage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _objM_HomeDataResponse = new M_HomeDataResponse();
     _objHeaderModel        = new HeaderModel();
     _baseUrl     = Settings.Url + Domain.M_HomeDataApiConstant;
     _apiServices = new RestApi();
 }
        public ServiceResult <HeaderModel> Header()
        {
            var korisnik = authService.TrenutniKorisnik();

            HeaderModel model = null;


            return(new OkServiceResult <HeaderModel>(model));
        }
Exemple #24
0
        private void AddKeyVal()
        {
            var header = new HeaderModel(this.Headers)
            {
                IsChecked = true
            };

            this.Headers.Add(header);
        }
        private TransferOutputModel _JsonOutput(HeaderModel header, TransferOutputDataModel data)
        {
            TransferOutputModel transferOutputModel = new TransferOutputModel {
                header = header,
                body   = data
            };

            return(transferOutputModel);
        }
 public WorksheetSignOffPopUp()
 {
     InitializeComponent();
     //  LoadID = Loadid;
     _apiServices = new RestApi();
     _baseUrl     = Settings.Url + Domain.WorkSheetSignOffSigApiConstant;
     _objDriver_WorkSheetSignOffResponse = new Driver_WorkSheetSignOffResponse();
     _objHeaderModel = new HeaderModel();
 }
Exemple #27
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            HeaderModel model = new HeaderModel()
            {
                Pages = await _content.GetPages()
            };

            return(View(model));
        }
        public HeaderViewModel(HeaderModel header, IConfiguration config)
        {
            if (config != null)
            {
                this.StorageBaseUrl = config["storageBaseUrl"];
                this.StorageBucket  = config["storageBucket"];
            }

            if (header != null)
            {
                this.ContainerVersion        = header.ContainerVersion;
                this.HeaderId                = header.HeaderId;
                this.Category                = header.Category;
                this.ValidatorName           = header.ValidatorName;
                this.IssuerName              = header.IssuerName;
                this.RecipientName           = header.RecipientName;
                this.IssuerUuid              = header.IssuerUuid;
                this.ValidatorUuid           = header.ValidatorUuid;
                this.ValidatorLegitimationId = header.ValidatorLegitimationId;
                this.RecipientUuid           = header.RecipientUuid;
                this.PreviousHeaderId        = header.PreviousHeaderId;
                this.NextHeaderId            = header.NextHeaderId;

                int ts = 0;

                this.Timestamp         = String.IsNullOrEmpty(header.Timestamp) ? (DateTime?)null : new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Int32.TryParse(header.Timestamp, out ts) ? ts : 0);
                this.BlockNumber       = header.BlockNumber;
                this.DataAddress       = header.DataAddress;
                this.ValidationExpiry  = header.ValidationExpiry;
                this.ValidationCounter = header.ValidationCounter;
                this.DataHash          = header.DataHash;
                this.Nonce             = String.IsNullOrEmpty(header.Nonce) ? header.Nonce : Utils.Convert.ToHexString(header.Nonce);
                this.Link           = header.Stored ? header.HeaderId : null;
                this.Attachment     = header.Attachment;
                this.GlobalHash     = header.GlobalHash;
                this.ValidatorImage = header.ValidatorProfile?.Image != null?System.Convert.ToBase64String(header.ValidatorProfile?.Image) : String.Empty;

                this.IssuerImage = header.IssuerProfile?.Image != null?System.Convert.ToBase64String(header.IssuerProfile?.Image) : String.Empty;

                CategoryList = new List <DDLItem>()
                {
                    new DDLItem()
                    {
                        ID = String.Empty, Desc = String.Empty
                    }
                };

                foreach (string cat in Enum.GetNames(typeof(CVProof.Models.Category)))
                {
                    CategoryList.Add(new DDLItem()
                    {
                        ID = cat, Desc = cat
                    });
                }
            }
        }
Exemple #29
0
 public Mechanic_SignaturePage(Int32 MaintananceId)
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _apiServices            = new RestApi();
     _baseUrl                = Settings.Url + Domain.M_SignatureApiConstant;
     _objM_SignatureResponse = new M_SignatureResponse();
     _objHeaderModel         = new HeaderModel();
     M_MR_DoneId             = MaintananceId;
 }
 public Driver_SelectVehiclePage()
 {
     InitializeComponent();
     NavigationPage.SetHasNavigationBar(this, false);
     _objDriverSelectVehicleResonse = new DriverSelectVehicleResonse();
     _baseUrl        = Settings.Url + Domain.SelectVehicleApiConstant;
     _apiServices    = new RestApi();
     _objHeaderModel = new HeaderModel();
     LoadPageData();
 }
 /// <summary>
 ///     Построить заголовок SOAP-запроса
 /// </summary>
 /// <param name="model">
 ///     Модель заголовка SOAP-запроса
 /// </param>
 /// <returns>
 ///     Заголовок SOAP-запроса
 /// </returns>
 public static string Build(HeaderModel model)
 {
     return string.Format(
         @"<wsse:Security xmlns:wsse=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"">
     <ds:Signature xmlns:ds=""http://www.w3.org/2000/09/xmldsig#"">
     <ds:SignedInfo xmlns:ds=""http://www.w3.org/2000/09/xmldsig#"">
     <ds:CanonicalizationMethod Algorithm=""http://www.w3.org/2001/10/xml-exc-c14n#""/>
     <ds:SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#rsa-sha1""/>
     <ds:Reference URI=""#{0}"">
         <ds:Transforms>
             <ds:Transform Algorithm=""http://www.w3.org/2001/10/xml-exc-c14n#""/>
         </ds:Transforms>
         <ds:DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1""/>
         <ds:DigestValue>{1}</ds:DigestValue>
     </ds:Reference>
     </ds:SignedInfo>
     <ds:SignatureValue></ds:SignatureValue>
     </ds:Signature>
     </wsse:Security>", model.Uri, model.DigestValue);
 }