/// <summary> /// 获取列表 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static IEnumerable <DC_SUPPLIESPROP_Model> getModelList(DC_SUPPLIESPROP_SW sw) { var result = new List <DC_SUPPLIESPROP_Model>(); DataTable dt = BaseDT.DC_SUPPLIESPROP.getDT(sw);//列表 for (int i = 0; i < dt.Rows.Count; i++) { DC_SUPPLIESPROP_Model m = new DC_SUPPLIESPROP_Model(); m.DC_SUPPLIESPROP_ID = dt.Rows[i]["DC_SUPPLIESPROP_ID"].ToString(); m.DCSUPPROPNAME = dt.Rows[i]["DCSUPPROPNAME"].ToString(); m.DCSUPPROPMODEL = dt.Rows[i]["DCSUPPROPMODEL"].ToString(); m.DCSUPPROPUNIT = dt.Rows[i]["DCSUPPROPUNIT"].ToString(); m.MARK = dt.Rows[i]["MARK"].ToString(); m.DCSUPPROPFACTORY = dt.Rows[i]["DCSUPPROPFACTORY"].ToString(); m.REPERTORYCOUNT = BaseDT.DC_SUPPLIES.getNum(new DC_SUPPLIES_SW { SUPID = m.DC_SUPPLIESPROP_ID }); m.PRICE = BaseDT.DC_SUPPLIES.getPrice(new DC_SUPPLIES_SW { SUPID = m.DC_SUPPLIESPROP_ID }); result.Add(m); } dt.Clear(); dt.Dispose(); return(result); }
/// <summary> /// 单位下拉框 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static string getSelectOption(DC_SUPPLIESPROP_SW sw) { StringBuilder sb = new StringBuilder(); DataTable dt = BaseDT.DC_SUPPLIESPROP.getDT(sw); for (int i = 0; i < dt.Rows.Count; i++) { string DCSUPPROPUNIT = dt.Rows[i]["DCSUPPROPUNIT"].ToString(); sb.AppendFormat("<option value=\"{0}\">{1}</option>", DCSUPPROPUNIT, DCSUPPROPUNIT); } dt.Clear(); dt.Dispose(); return(sb.ToString()); }
/// <summary> /// 物资名称下拉框 /// </summary> /// <param name="sw"></param> /// <returns></returns> public static string getnameSelectOption(DC_SUPPLIESPROP_SW sw) { StringBuilder sb = new StringBuilder(); DataTable dt = BaseDT.DC_SUPPLIESPROP.getDT(sw); if (sw.isShowAll == "1") { sb.AppendFormat("<option value=\"\">{0}</option>", "--所有--"); } for (int i = 0; i < dt.Rows.Count; i++) { string DCSUPPROPNAME = dt.Rows[i]["DCSUPPROPNAME"].ToString(); string DC_SUPPLIESPROP_ID = dt.Rows[i]["DC_SUPPLIESPROP_ID"].ToString(); sb.AppendFormat("<option value=\"{0}\">{1}</option>", DC_SUPPLIESPROP_ID, DCSUPPROPNAME); } dt.Clear(); dt.Dispose(); return(sb.ToString()); }
/// <summary> /// 获取物资名称+型号json /// </summary> /// <param name="sw"></param> /// <returns></returns> public static string getSupMOJsonStr(DC_SUPPLIESPROP_SW sw) { DataTable dt = BaseDT.DC_SUPPLIESPROP.getDT(sw); char[] specialChars = new char[] { ',' }; string JSONstring = "["; for (int i = 0; i < dt.Rows.Count; i++) { string Id = dt.Rows[i]["DC_SUPPLIESPROP_ID"].ToString(); string Name = dt.Rows[i]["DCSUPPROPNAME"].ToString(); string Model = dt.Rows[i]["DCSUPPROPMODEL"].ToString(); JSONstring += "{"; JSONstring += "\"id\":\"" + Id + "\","; JSONstring += "\"text\":\"" + Name + "【" + Model + "】\""; JSONstring += "},"; } JSONstring = JSONstring.TrimEnd(specialChars); JSONstring += "]"; return(JSONstring.ToString()); }