public ActionResult AddPSKU(string PSKU, string SSKU, string GSKU, string shopid) { ComResult com = new ComResult(); try { if (!Regex.IsMatch(shopid, @"^\+?[1-9][0-9]*$") && !string.IsNullOrEmpty(shopid)) { com.Msg = "只能是数字且不能为空"; com.State = 0; return(Json(com)); } var isok = CommService.AddPSKU(PSKU, SSKU, GSKU, Convert.ToInt32(shopid)); if (isok) { com.State = 1; com.Msg = "添加成功"; } else { com.State = 0; com.Msg = "添加失败"; } return(Json(com)); } catch (Exception ex) { com.State = 0; com.Msg = "添加失败,原因:" + ex.ToString(); return(Json(com)); } }