예제 #1
0
 public JsonResult GetNextColorNumber(int colorID)
 {
     try
     {
         return(Json(PolishModel.getNextColorNumber(colorID)));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message));
     }
 }
예제 #2
0
        public JsonResult GetPolishQuickInfo(string colorName)
        {
            try
            {
                using (var db = new PolishWarehouseEntities())
                {
                    var c = db.Colors.Where(b => b.Name == colorName).SingleOrDefault();
                    if (c == null)
                    {
                        throw new Exception("Color Doesn't exist!");
                    }

                    return(Json(new { id = c.ID, number = PolishModel.getNextColorNumber(c.ID) }));
                }
            }
            catch (Exception ex)
            {
                return(Json(ex.Message));
            }
        }