| | |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using System.Windows.Forms; |
| | | |
| | | using SyntacticSugar.constant; |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Pay_ErrWorkTimesRequestBillController : ApiController |
| | |
| | | objJsonResult.Message = "æ¥è¯¢å表信æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¼å¸¸å·¥æ¶ç³è¯·åå表å页å表 |
| | | [Route("Pay_ErrWorkTimesRequestBillController/page")] |
| | | [HttpGet] |
| | | public json Pay_ErrWorkTimesRequestBillPage(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; |
| | | } |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Pay_ErrWorkTimesRequestBillList " + page + "," + size + ",''", "h_p_Pay_ErrWorkTimesRequestBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Pay_ErrWorkTimesRequestBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Pay_ErrWorkTimesRequestBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 |
| | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | string sql = "insert into Pay_ErrWorkTimesRequestBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate,HInnerBillNo,HDeptID,HGroupID,HMangerID,HICMOInterID,HICMOBillNo,HExplanation,HSumRequestTimes,HMaterID,HUnitID,HPlanQty,HBatchNo,HRemark, HMaker,HMakeDate) " + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate,HInnerBillNo,HDeptID,HGroupID,HMangerID,HICMOInterID,HICMOBillNo,HExplanation,HSumRequestTimes,HMaterID,HUnitID,HPlanQty,HBatchNo,HRemark, HMaker,HMakeDate,HIsImport) " + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | "','" + HRemark + |
| | | "','" + HMaker + |
| | | "','" + HMakerDate + |
| | | "','" + 0 + //夿æ¯å¦æ¯å¯¼å
¥ |
| | | "')"; |
| | | |
| | | //主表 |