Beispiel #1
0
        public JsonResult IsBrancheShortName_Available(string ShortName)
        {
            Branche theBranche   = new Branche();
            int     brancheCount = theBranche.GetAll("S_NAME = '" + ShortName + "'").Count;

            if (brancheCount > 0)
            {
                string suggestedUID = String.Format(CultureInfo.InvariantCulture,
                                                    "Филиал {0} уже существует.", ShortName);
                return(Json(suggestedUID, JsonRequestBehavior.AllowGet));
            }
            return(Json(true, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        //
        // GET: /Branch/

        public ActionResult Index()
        {
            if (!Access.HasAccess(6))
            {
                System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary();
                route.Add("err", "Нет доступа!");
                return(RedirectToAction("Error", "Home", route));
            }

            Branche        theBranche     = new Branche();
            List <Branche> theListBranche = new List <Branche>();

            theListBranche = (List <Branche>)theBranche.GetAll();

            return(View(theListBranche));
        }