public JsonResult GetYLCPDetailsByMXID(int mxid) { var mxModel = T_XSMXDomain.GetInstance().GetModelById(mxid); if (mxModel != null) { T_YLCP cp = T_YLCPDomain.GetInstance().GetCpDetailsById(mxModel.CPID); if (cp != null) { string resultStr = JsonConvert.SerializeObject(new { CPID = cp.CPID, CPBH = cp.CPBH, SCQYMC = (cp.T_SupQY1 != null && !string.IsNullOrEmpty(cp.T_SupQY1.SupMC)) ? cp.T_SupQY1.SupMC : "", CPGG = cp.CPGG, CPXH = cp.CPXH, CPDW = cp.CPDW, XKZH = (cp.T_SupQY1 != null && !string.IsNullOrEmpty(cp.T_SupQY1.SupXKZBH)) ? cp.T_SupQY1.SupXKZBH : "", ZCZH = cp.CPZCZ, SCQYID = cp.CPSCQYID, CPPrice = mxModel.XSJG, SUPQYID = cp.CPGYSID, SUPQYMC = (cp.T_SupQY != null && !string.IsNullOrEmpty(cp.T_SupQY.SupMC)) ? cp.T_SupQY.SupMC : "", XSJG = cp.XSJG, CPMC = cp.CPMC, CPNUM = mxModel.CPSL, CYTJ = cp.CCTJ }); return(Json(resultStr)); } } return(Json("")); }
public void GetCpByQy(string id) { string result1 = ""; Dictionary <string, string> dict = new Dictionary <string, string>(); try { StringBuilder result = new StringBuilder(); result.Append("[[\"\",\"请选择\"]"); //result.Append("["); if (string.IsNullOrEmpty(id)) { result.Append("]"); result1 = result.ToString(); } T_YLCP ylcp = new T_YLCP(); ylcp.CPGYSID = int.Parse(id); ylcp.CPStatus = 1; var list = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcp); foreach (var item in list) { result.Append(",["); result.Append("\"" + item.CPID + "\","); result.Append("\"" + item.CPMC + "\""); result.Append("]"); } result.Append("]"); result1 = result.ToString(); } catch (Exception ex) { } Response.ContentType = "text/json"; Response.Write(result1); }
public JsonResult GetYLCPDetailsID(int id) { T_YLCP cp = T_YLCPDomain.GetInstance().GetCpDetailsById(id); if (cp != null) { string resultStr = JsonConvert.SerializeObject(new { CPID = cp.CPID, CPBH = cp.CPBH, SCQYMC = (cp.T_SupQY1 != null && !string.IsNullOrEmpty(cp.T_SupQY1.SupMC)) ? cp.T_SupQY1.SupMC : "", CPGG = cp.CPGG, CPXH = cp.CPXH, CPDW = cp.CPDW, XKZH = (cp.T_SupQY1 != null && !string.IsNullOrEmpty(cp.T_SupQY1.SupXKZBH)) ? cp.T_SupQY1.SupXKZBH : "", ZCZH = cp.CPZCZ, SCQYID = cp.CPSCQYID, CPPrice = cp.CPPrice, SUPQYID = cp.CPGYSID, SUPQYMC = (cp.T_SupQY != null && !string.IsNullOrEmpty(cp.T_SupQY.SupMC)) ? cp.T_SupQY.SupMC : "", XSJG = cp.XSJG, CPMC = cp.CPMC }); return(Json(resultStr)); } return(Json("")); }
public JsonResult GetYLCP(string cpid) { T_YLCP cp = T_YLCPDomain.GetInstance().GetModelById(Convert.ToInt32(cpid)); if (cp != null) { string scqyMc = ""; if (cp.CPSCQYID.HasValue) { var scqy = T_SupQYDomain.GetInstance().GetModelById(cp.CPSCQYID); if (scqy != null && !string.IsNullOrEmpty(scqy.SupMC)) { scqyMc = scqy.SupMC; } } string resultStr = JsonConvert.SerializeObject(new { CPGG = cp.CPGG, CPPrice = cp.CPPrice, CPDW = cp.CPDW, SCQYMC = scqyMc, SCQYID = cp.CPSCQYID }); //string str = "{\"CPGG\":\"" + cp.CPGG + "\"}"; return(Json(resultStr)); } else { return(Json("")); } }