public ActionResult InsertClient(ServiceReference1.Client client) { if (Session["userToken"] == null) { return(RedirectToAction("Login")); } if (string.IsNullOrEmpty(client.address) || string.IsNullOrEmpty(client.firstname) || string.IsNullOrEmpty(client.lastname) || string.IsNullOrEmpty(client.phone) ) { ViewBag.ErrorMessage = "Please provide all required information to add a new client."; return(RedirectToAction("Index")); } try { serviceRef.InsertClient(Session["userToken"].ToString(), client); } catch (Exception ex) { ViewBag.ErrorMessage = ex.Message; } return(RedirectToAction("Index")); }
public ClientWrapper(ServiceReference1.Client client) { this.ID = client.ID; this.lastname = client.lastname; this.firstname = client.firstname; this.address = client.address; this.phone = client.phone; var json = new JavaScriptSerializer().Serialize(client); json = Regex.Replace(json, "\\\"ExtensionData\\\":{},", String.Empty); this.urlEncodedJsonClient = HttpUtility.UrlEncode(json); }
public ClientForm() { client = new ServiceReference1.Client(); }
public System.Threading.Tasks.Task UpdateClientAsync(ServiceReference1.Client client) { return(base.Channel.UpdateClientAsync(client)); }
public System.Threading.Tasks.Task AddCustomerAsync(ServiceReference1.Client client) { return(base.Channel.AddCustomerAsync(client)); }