| | |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using System.Windows.Forms; |
| | | using SyntacticSugar.constant; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | |
| | | objJsonResult.Message = "æ¥è¯¢å表信æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥èµç»ç®å(éä½)å页å表 |
| | | [Route("Pay_GroupBalBillController/page")] |
| | | [HttpGet] |
| | | public json Pay_GroupBalBillPage(string sWhere, string user, int page, int size) |
| | | { |
| | | DataSet ds; |
| | | json res = new json(); |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameList, 3, false, user)) |
| | | { |
| | | objJsonResult.code = CodeConstant.FAIL; |
| | | objJsonResult.count = CountConstant.FAIL; |
| | | objJsonResult.Message = "æ¨æ²¡æè¯¥æ¨¡åæé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦ææ¥çå
¨é¨çç»çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Group_AllQuery", 3, false, user)) |
| | | { |
| | | //å¦ææ²¡æè¿ä¸ªæé |
| | | //æ ¹æ®ç¨æ·å¯¹åºçç»çå
³ç³»ï¼è¿æ»¤æ¡ä»¶ä¸å¢å åªæ¾ç¤ºå¯¹åºççç» |
| | | DataSet dsHitemID = oCn.RunProcReturn("exec h_p_Gy_GetSQLGroupByUser '" + user + "'", "h_p_Gy_GetSQLGroupByUser"); |
| | | string sqlGroupID = DBUtility.ClsPub.isStrNull(dsHitemID.Tables[0].Rows[0]["HBack"]); |
| | | if (sqlGroupID == "" || sqlGroupID == null)//å¦ææ²¡æç»å®çç»å让ä»çä¸å°ææ |
| | | { |
| | | sqlGroupID = "and 1 = 2"; |
| | | } |
| | | sqlGroupID = sqlGroupID.Replace("HitemID", "HGroupID");//æ¿æ¢sqlè¯å¥ä¸çHitemID |
| | | sWhere = sWhere + sqlGroupID; |
| | | } |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBillList " + page + "," + size + ",''", "h_p_Pay_GroupBalBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Pay_GroupBalBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | res.code = CodeConstant.SUCCEED; |
| | | res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | res.Message = "Sucessï¼"; |
| | | res.list = columnNameList; |
| | | res.data = ds.Tables[0]; |
| | | return res; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | res.code = CodeConstant.FAIL; |
| | | res.count = CountConstant.FAIL; |
| | | res.Message = "Exceptionï¼" + e.ToString(); |
| | | res.data = null; |
| | | return res; |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥èµç»ç®å(éä½) æ¹éå®¡æ ¸ |
| | | /// <summary> |
| | | /// å®¡æ ¸/åå®¡æ ¸å·¥èµç»ç®å(éä½) |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="Type">å®¡æ ¸(1),åå®¡æ ¸(2)</param> |
| | | /// <param name="HMaker">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("Pay_GroupBalBillController/CheckAll")] |
| | | [HttpGet] |
| | | public object CheckAll(string ids, int Type, string HMaker) |
| | | { |
| | | try |
| | | { |
| | | //å¤çå符串 |
| | | if (!string.IsNullOrEmpty(ids)) |
| | | { |
| | | long[] idArray = Array.ConvertAll(ids.Split(','), long.Parse); |
| | | // å¤çidArray... |
| | | oCn.BeginTran(); |
| | | for (int i = 0; i < idArray.Length; i++) |
| | | { |
| | | objJsonResult = (json)GetPay_GroupBalBill_Check_Json(idArray[i], Type, HMaker);//å®¡æ ¸æ§è¡ |
| | | if (objJsonResult.count == 0) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.Message += "第" + (i + 1) + "è¡åºç°é®é¢æ æ³ç»§ç»å®æ"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | oCn.Commit(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è¯·éæ©æ£ç¡®è¡"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = CodeConstant.SUCCEED; |
| | | objJsonResult.count = CountConstant.SUCCEED; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸æåå®¡æ ¸å·¥èµç»ç®å(个人)失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å·¥èµç»ç®åï¼éä½ï¼ å
³é/åå
³é |
| | | /// <summary> |
| | | /// å
³é/åå
³éå·¥èµç»ç®åï¼éä½ï¼ |