private void Start() { currentPeriod = PlayerPrefs.GetInt("CurrentPeriod", 0); map.GetComponent <SpriteRenderer> ().sprite = mapSprites[currentPeriod]; auc = txtPeriod.GetComponent <AboutUsController> (); setValues(); }
public void BindGrid() { try { grdAbout.DataSource = AboutUsController.GetAboutUs(); grdAbout.DataBind(); } catch (Exception ex) { throw ex; } }
public void IndexTest() { // Arrange AboutUsController controller = new AboutUsController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.Equal("", result?.ViewData["Message"]); //проверяет значение по ключу "Message" в словаре ViewData Assert.NotNull(result); //Тестируем результат метода - возвращаемый объект ViewResult не должен иметь значение null Assert.Equal("Index", result?.ViewName); //Проверяет название вызываемого представления }
//public string GetABoutUs() //{ // try // { // List<AboutU> lstAboutUs = AboutUsController.GetAboutUs(); // string abtUs = ""; // foreach (var obj in lstAboutUs) // { // abtUs += "<p class='h-desc gray4'>"; // abtUs += " <span class='colored uppercase extrabold condensed'>" + obj.heading + "</span>"; // abtUs += "<br />"; // abtUs += " <br />"; // abtUs += obj.Description; // abtUs += "</p>"; // } // return abtUs; // } // catch (Exception ex) // { // throw ex; // } //} //public string GetABoutUsImages() //{ // try // { // List<AboutU> lstAboutUs = AboutUsController.GetAboutUs(); // string abtUs = ""; // foreach (var obj in lstAboutUs) // { // if (obj.image != "") // abtUs += "<img src='" + obj.image + "' style='height: 100%; width: 100%;' /><br />"; // } // return abtUs; // } // catch (Exception ex) // { // throw ex; // } //} public void AddPanes() { try { //HtmlGenericControl h3 = new HtmlGenericControl(); //h3 = header3; accAboutUs.DataSource = AboutUsController.GetAboutUs(); accAboutUs.DataBind(); } catch (Exception ex) { throw ex; } }
public void BindValues() { try { AboutU objAbout = AboutUsController.GetAboutUsById(AboutUsId); txtDescp.Text = objAbout.Description; txtHeading.Text = objAbout.heading; //if (objAbout.image != "") // abtUsImg.ImageUrl = objAbout.image; } catch (Exception ex) { throw ex; } }
public void UpdateAboutUs() { try { AboutU objAbout = AboutUsController.GetAboutUsById(AboutUsId); objAbout.heading = txtHeading.Text; objAbout.Description = txtDescp.Text; //if (fileUpldImg.HasFile) //{ // string fileName = Path.GetFileName(fileUpldImg.FileName); // string path = Server.MapPath("~/assets/assets/images/fitness/" + fileName); // fileUpldImg.SaveAs(path); // objAbout.image = "~/assets/assets/images/fitness/" + fileName; //} objAbout = new AboutUsController().UpdateAboutUs(objAbout); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "succ_msg", "MessageBox('Success','Data Updated');", true); } catch (Exception ex) { throw ex; } }