| | |
| | | return ds; |
| | | } |
| | | /// <summary> |
| | | /// 获取物料列表 |
| | | /// </summary> |
| | | /// <param name="sWhere"></param> |
| | | /// <param name="sErr"></param> |
| | | /// <returns></returns> |
| | | public DataSet GetMaterialList(string sWhere, ref string sErr) |
| | | { |
| | | DataSet ds = new DataSet(); |
| | | ds = oCn.RunProcReturn("select * from h_v_IF_Material " + sWhere, "h_v_IF_Material"); |
| | | //DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View(); |
| | | return ds; |
| | | } |
| | | /// <summary> |
| | | /// 职员列表 |
| | | /// </summary> |
| | | /// <param name="sWhere"></param> |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using SQLHelper; |
| | | using System; |
| | |
| | | Int64 RowTotal = Common.GetRowTotal("h_v_SRM_BarCodeBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //获取返回数据 |
| | | ds = oCn.RunProcReturn("exec h_p_SRM_BarCodeBillList '" + PcWhere + "'", "h_v_SRM_BarCodeBillList"); |
| | | //添加列名 |
| | | List<object> columnNameList = new List<object>(); |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objjson.code = "0"; |
| | |
| | | objjson.code = "0"; |
| | | objjson.count = 10000; |
| | | objjson.Message = "获取成功"; |
| | | objjson.list = columnNameList; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using SQLHelper; |
| | | using System; |
| | |
| | | Int64 RowTotal = Common.GetRowTotal("H_v_SRM_EntrustOrderBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //获取返回数据 |
| | | ds = oCn.RunProcReturn("exec H_p_SRM_EntrustOrderBillList '" + PcWhere + "'", "H_p_SRM_EntrustOrderBillList"); |
| | | //添加列名 |
| | | List<object> columnNameList = new List<object>(); |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 10000; |
| | | objjson.Message = "获取成功"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | objjson.list = columnNameList; |
| | | return objjson; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取物料列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("GetMaterialList_Json")] |
| | | [HttpGet] |
| | | public object GetMaterialList_Json(string Material) |
| | | { |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1"; |
| | | ////sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | //if (Material != "") |
| | | //{ |
| | | // sWhere = sWhere + " and ( HNumber like '%" + Material + "%' or HName like '%" + Material + "%' ) "; |
| | | //} |
| | | try |
| | | { |
| | | ds = webserver.GetMaterialList(Material, ref DBUtility.ClsPub.sErrInfo); |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |