예제 #1
0
        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"));
        }
예제 #2
0
        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);
        }
예제 #3
0
 public ClientForm()
 {
     client = new ServiceReference1.Client();
 }
예제 #4
0
 public System.Threading.Tasks.Task UpdateClientAsync(ServiceReference1.Client client)
 {
     return(base.Channel.UpdateClientAsync(client));
 }
예제 #5
0
 public System.Threading.Tasks.Task AddCustomerAsync(ServiceReference1.Client client)
 {
     return(base.Channel.AddCustomerAsync(client));
 }