Beispiel #1
0
        public JsonResult AddDeviceType(string TypeName, string TypeSymbol, string Notes)
        {
            Ql.AddDeviceType(TypeName, TypeSymbol, Notes);
            bool result = true;

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public ActionResult AddDeviceType(FormCollection collection)
        {
            string TypeName   = collection["TypeName"];
            string Notes      = collection["Notes"];
            string TypeSymbol = collection["TypeSymbol"];

            data.AddDeviceType(TypeName, TypeSymbol, Notes);
            return(RedirectToAction("DeviceType", "DeviceType"));
        }
        public JsonResult AddDeviceType(string TypeName, string TypeSymbol, string Notes)
        {
            bool result  = false;
            var  listdvt = data.DeviceTypes.Where(x => x.TypeSymbol.Trim() == TypeSymbol.Trim()).ToList();

            if (listdvt.Count() > 0)
            {
                result = false;
            }
            else
            {
                data.AddDeviceType(TypeName, TypeSymbol, Notes);
                result = true;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }