public ActionResult AddAuthorized(AuthorizedService model) { if (ModelState.IsValid) { repository.Insert(model); repository.Save(); return(RedirectToAction("Login", "Authorized")); } return(View()); }
public ActionResult EditAuthorized(AuthorizedService model) { if (ModelState.IsValid) { repository.Update(model); repository.Save(); return(RedirectToAction("Index", "Authorized")); } else { return(View(model)); } }
public ActionResult Login(AuthorizedService LoginAuthorized) { IEnumerable <AuthorizedService> authorizeds = repository.GetAll(); AuthorizedService authorizedService = authorizeds.FirstOrDefault(x => x.Email == LoginAuthorized.Email && x.Password == LoginAuthorized.Password); if (authorizedService != null) { AuthorizedId = authorizedService.AuthorizedID; FormsAuthentication.SetAuthCookie(authorizedService.Email, false); return(RedirectToAction("Index", "Authorized")); } else { ViewBag.Message = "E-posta veya Şifre yanlış"; return(View()); } }
public MemberAuth(AuthorizedService s) { InitializeComponent(); TheService = s; MemberService.Text = s.COSTCENTERDESC; MemberFunder.Text = s.FUNDER; string ed = s.ENDDATE.ToShortDateString(); if (ed.Trim() == "") { ed = "Open"; } MemberDateRange.Text = s.STARTDATE.ToShortDateString() + " - " + ed; MemberUnits.ValueText = s.UNITS.ToString(); MemberRemainingUnits.ValueText = s.REMAININGUNITS.ToString(); MemberProvider.Text = s.PROVIDERNAME; }
public override System.Xml.XmlDocument XmlSerialize() { System.Xml.XmlDocument document = base.XmlSerialize(); System.Xml.XmlNode propertiesNode = document.ChildNodes[1].ChildNodes[0]; #region Properties CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "EventTypeInt32", ((Int32)EventType).ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "EventType", EventType.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "MetricTypeInt32", ((Int32)MetricType).ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "MetricType", MetricType.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "MetricMinimum", MetricMinimum.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "MetricMaximum", MetricMaximum.ToString()); if (AuthorizedService != null) { CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "AuthorizedServiceId", AuthorizedService.Id.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "AuthorizedServiceName", AuthorizedService.Name); } if (Service != null) { CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "ServiceId", Service.Id.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "ServiceName", Service.Name); } if (Metric != null) { CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "MetricId", Metric.Id.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "MetricName", Metric.Name); } if (ProblemStatement != null) { CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "ProblemStatementId", ProblemStatement.Id.ToString()); CommonFunctions.XmlDocumentAppendPropertyNode(document, propertiesNode, "ProblemStatementName", ProblemStatement.Name); } #endregion #region Object Nodes if (Action != null) { document.LastChild.AppendChild(document.ImportNode(Action.XmlSerialize().LastChild, true)); } #endregion #region Dependencies Nodes System.Xml.XmlNode dependenciesNode = document.CreateElement("Dependencies"); document.LastChild.InsertBefore(dependenciesNode, propertiesNode); if (AuthorizedService != null) { dependenciesNode.AppendChild(document.ImportNode(AuthorizedService.XmlSerialize().LastChild, true)); } if (Service != null) { dependenciesNode.AppendChild(document.ImportNode(Service.XmlSerialize().LastChild, true)); } if (Metric != null) { dependenciesNode.AppendChild(document.ImportNode(Metric.XmlSerialize().LastChild, true)); } if (ProblemStatement != null) { dependenciesNode.AppendChild(document.ImportNode(ProblemStatement.XmlSerialize().LastChild, true)); } #endregion return(document); }
public UserSevice() { authorizedService = new AuthorizedService(); }