コード例 #1
0
        public ActionResult SwitchTableExpressPartialDelete(string Id)
        {
            Id = Id.Replace("\"", "");
            if (string.IsNullOrEmpty(Id))
            {
                Id = "0";
            }
            int id    = Int32.Parse(Id);
            var model = new SwitchListPartialModel();

            if (id > 0)
            {
                try
                {
                    var a = dbs.Read(id);
                    dbs.Delete(a);
                    model.Switches   = dbs.ReadAllWithFk(a.Customer.Id);
                    model.CustomerId = a.Customer.Id;
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            return(PartialView("~/Views/Customers/_SwitchTableExpressPartial.cshtml", model));
        }
コード例 #2
0
        public ActionResult SwitchTableExpressPartial(int customerid)
        {
            var model = new SwitchListPartialModel()
            {
                CustomerId = customerid,
                Switches   = dbs.ReadAllWithFk(customerid)
            };

            return(PartialView("~/Views/Customers/_SwitchTableExpressPartial.cshtml", model));
        }