Esempio n. 1
0
        public ActionResult CustomerFileListExpressPartialDelete(string Id)
        {
            Id = Id.Replace("\"", "");
            if (string.IsNullOrEmpty(Id))
            {
                Id = "0";
            }
            int id    = Int32.Parse(Id);
            var model = new CustomerFileList();

            if (id > 0)
            {
                try
                {
                    var d = dbFile.Read(id);

                    dbFile.Delete(d);
                    model.CustomerId    = d.Customer.Id;
                    model.CustomerFiles = dbFile.ReadAllWithFk(d.Customer.Id);
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            return(PartialView("~/Views/Customers/_CustomerFileListExpressPartial.cshtml", model));
        }
Esempio n. 2
0
        public ActionResult CustomerFileListExpressPartial(int?customerid)
        {
            var model = new CustomerFileList();

            if (customerid.HasValue)
            {
                if (isAuthorized(customerid.Value) == AuthState.NoAuth)
                {
                    return(PartialView("NotAuthorized"));
                }
                model.CustomerFiles = dbFile.ReadAllWithFk(customerid.Value);
                model.CustomerId    = customerid.Value;
            }
            return(PartialView("~/Views/Customers/_CustomerFileListExpressPartial.cshtml", model));
        }