public JsonResult DocInfos(string str) { retValue ret = new retValue(); BLL.DocBLL _DocBLL = new DocBLL(); JObject o = null; string content = string.Empty; if (!string.IsNullOrEmpty(str)) { o = JObject.Parse(str); string test1 = o["test1"]._ToStrTrim(); string test2 = o["test2"]._ToStrTrim(); string Type = o["Type"]._ToStrTrim(); string Name = o["Name"]._ToStrTrim(); string ISSN = o["ISSN"]._ToStrTrim(); string BKDH = o["BKDH"]._ToStrTrim().ToUpper(); string PublishArea = o["PublishArea"]._ToStrTrim(); ret = _DocBLL.GetDoc("", Type, Name, ISSN, PublishArea, "", "", test1, test2, BKDH); } content = ret.toJson(); var js = JsonConvert.SerializeObject(ret); return(Json(js, JsonRequestBehavior.AllowGet)); }
public JsonResult GetAllDocInfo(string str) { retValue ret = new retValue(); BLL.DocBLL _BLL = new DocBLL(); ret = _BLL.GetDoc(str, "", "", "", "", "", "", "", "", ""); var js = JsonConvert.SerializeObject(ret); return(Json(js, JsonRequestBehavior.AllowGet)); }
public ResponseDocAdd DocAdd([FromBody] RequestDocAdd request) { try { DocBLL bll = new DocBLL(); return(bll.DocAdd(request)); } catch (Exception ex) { throw new HttpResponseException( Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public JsonResult DocInfo_Delete(string str) { retValue ret = new retValue(); BLL.DocBLL _DocBLL = new DocBLL(); string content = string.Empty; if (!string.IsNullOrEmpty(str)) { ret = _DocBLL.DeleteByPK(str); } content = ret.toJson(); var js = JsonConvert.SerializeObject(ret); return(Json(js, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 初始化子页面 /// </summary> /// <returns></returns> public ActionResult DocInfo_AddEdit() { int addeditcode = Request["addeditcode"]._ToInt32(); if (addeditcode > 0) { List <retValue> resultList = new List <retValue>(); retValue ret = new retValue(); BLL.DocBLL _DocBLL = new DocBLL(); ret = _DocBLL.GetDoc(addeditcode._ToStr(), "", "", "", "", "", "", "", "", ""); resultList.Add(ret); ViewData.Model = resultList; } else { ViewData.Model = null; } return(View()); }
public JsonResult DocInfo_AddEdits(string str) { retValue ret = new retValue(); BLL.DocBLL _DocBLL = new DocBLL(); UserModel usermodel = Session["UserModel"] as UserModel; JObject o = null; if (!string.IsNullOrEmpty(str)) { o = JObject.Parse(str); string ID = o["ID"]._ToStrTrim(); string NGUID = o["NGUID"]._ToStrTrim(); string Type = o["Type"]._ToStrTrim(); string Name = o["Name"]._ToStrTrim(); string ISSN = o["ISSN"]._ToStrTrim(); string PublishArea = o["PublishArea"]._ToStrTrim(); string Publisher = o["Publisher"]._ToStrTrim(); string Price = o["Price"]._ToStrTrim(); string PL = o["PL"]._ToStrTrim(); string BKDH = o["BKDH"]._ToStrTrim().ToUpper(); //新增 if (string.IsNullOrEmpty(ID)) { ret = _DocBLL.Insert(Name, ISSN, Type, PublishArea, Publisher, Price, PL, BKDH, usermodel._ID._ToStr()); } //更新 else { ret = _DocBLL.UpdateByPK(ID._ToInt32(), Name, ISSN, Type, PublishArea, Publisher, Price, PL, BKDH, NGUID); } } var js = JsonConvert.SerializeObject(ret); return(Json(js, JsonRequestBehavior.AllowGet)); }