| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 样品销售出库单列表-分页 |
| | | /// <summary> |
| | | /// 销售出库单列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Kf_SellOutBill/GetSellOutBillList_byPage_YP")] |
| | | [HttpGet] |
| | | public object GetSellOutBillList_byPage_YP(string sWhere, string user, string Organization, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //定义声明变量 ,把通过 new List<object>()创建的 实例,赋值给变量 |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_SellOutBill_YP_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_SellOutBillList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_IF_SellOutBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_IF_SellOutBillList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_IF_SellOutBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | ///销售出库单删除功能 |
| | | /// </summary> |
| | |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by hmainid desc", "h_v_Kf_OtherOutBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by 制单日期 desc", "h_v_Kf_OtherOutBillList"); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1 order by hmainid desc", "h_v_Kf_OtherInBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1 order by 制单日期 desc", "h_v_Kf_OtherInBillList"); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | //oItem.HInterID =0; |
| | | //oItem.HBillNo = ""; |
| | | oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --日期 |
| | | //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --日期 |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | //oItem.HMakeDate = ""; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 器具点检计划单 关闭/反关闭 |
| | | #region 器具点检记录单 关闭/反关闭 |
| | | /// <summary> |
| | | /// </summary> |
| | | /// <param name="HInterID">单据ID</param> |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | sWhere = sWhere?.Replace("'", "''") ?? ""; |
| | | if (string.IsNullOrEmpty(sWhere)) |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBillList_Query " + page + "," + size + ",''", "h_p_Sc_MouldLifeChangeBillList_Query"); |
| | | } |
| | |
| | | ds = oCn.RunProcReturn("exec h_p_Sc_MouldLifeChangeBillList_Query " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldLifeChangeBillList_Query"); |
| | | } |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | // 添加空值检查 |
| | | if (ds == null || ds.Tables.Count == 0) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查询成功,但无数据!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | // 检查第一个表 |
| | | if (ds.Tables[0] != null) |
| | | { |
| | | //添加列名 |
| | | 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)); |
| | | } |
| | | } |
| | | |
| | | // 检查第二个表和行数据 |
| | | int totalCount = 0; |
| | | if (ds.Tables.Count > 1 && ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0) |
| | | { |
| | | var countRow = ds.Tables[1].Rows[0]["count"]; |
| | | if (countRow != null && countRow != DBNull.Value) |
| | | { |
| | | totalCount = int.Parse(countRow.ToString()); |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.count = totalCount; |
| | | objJsonResult.Message = "Success!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.data = ds.Tables[0] ?? new DataTable(); // 确保不为null |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |