private void AcceptEvent() { acceptBtn.ServerClick += delegate { var apps = new Project_Dll.Appointment(Session["appid"].ToString()); apps.updateField("status", "accepted", apps.Id); Session["message"] = new HtmlElements().GetMesage("", HtmlElements.MessageType.SUCCESS, HtmlElements.UserType.DOCTOR); Response.Redirect(new NavClass().DoctorHome); }; }
private void RegDoctor() { NxtBtn.ServerClick += delegate { if (!IsEmpty(fnameBox.Value) && !IsEmpty(emailBox.Value) && !IsEmpty(contactBox.Value) && !IsEmpty(lname.Value) && !IsIndexZero(professionSelect.Value) && !IsEmpty(dob.Value) && !IsIndexZero(genderSelect.Value) && !IsEmpty(addressBox.Value)) { Session["fname"] = fnameBox.Value; Session["lname"] = lname.Value; Session["email"] = emailBox.Value; Session["contact"] = contactBox.Value; Session["profession"] = professionSelect.Value; Session["date"] = dob.Value; Session["gender"] = genderSelect.Value; Session["address"] = addressBox.Value; Response.Redirect(nav.ManNewDoctorDetails); } Session["message"] = new HtmlElements().GetMesage("Fields can not be empty!", HtmlElements.MessageType.ERROR, HtmlElements.UserType.MANAGEMENT); Response.Redirect(nav.ManNewDoctor); }; }
private void FindElementsByType(IHtmlDocument document, HtmlType serchType) { string htmlSerchElement = null; if (serchType == HtmlType.Title) { htmlSerchElement = "title"; } else if (serchType == HtmlType.Description) { htmlSerchElement = "meta"; } else if (serchType == HtmlType.H1) { htmlSerchElement = "h1"; } else if (serchType == HtmlType.Img) { htmlSerchElement = "img"; } else if (serchType == HtmlType.Ahref) { htmlSerchElement = "a"; } else if (serchType == HtmlType.Link) { htmlSerchElement = "link"; } var foundHtmlElements = document.All.Where(d => d.LocalName == htmlSerchElement); foreach (var item in foundHtmlElements) { HtmlElements foundHtml = null; if (serchType == HtmlType.Description) { if (item.OuterHtml.Contains("name=\"description\"")) { foundHtml = new HtmlElements() { Content = item.GetAttribute("content"), }; } } else if (serchType == HtmlType.Img) { foundHtml = new HtmlElements() { Content = item.GetAttribute("src"), }; } else if (serchType == HtmlType.Ahref || serchType == HtmlType.Link) { foundHtml = new HtmlElements() { Content = item.GetAttribute("href"), }; } else { foundHtml = new HtmlElements() { Content = item.TextContent, }; } if (foundHtml != null) { foundHtml.TypeId = (int)serchType; foundHtml.Html = item.OuterHtml; foundHtml.Url = _url; FoundElements.Add(foundHtml); } } }