| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using SyntacticSugar.constant; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region è´¨éæåº¦ç®æ å å页å表 |
| | | [Route("QC_MonthTarGetBill/getQC_MonthTarGetBillListPage")] |
| | | [HttpGet] |
| | | public json getQC_MonthTarGetBillListPage(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("QC_MonthTarGetBill_Query", 3, 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_QC_MonthTarGetBillMainList " + page + "," + size + ",''", "h_p_QC_MonthTarGetBillMainList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_QC_MonthTarGetBillMainList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_MonthTarGetBillMainList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 |
| | | |
| | | |
| | | #region è´¨éæåº¦ç®æ å ä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// 项ç®éªæ¶å |
| | |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string refSav = sArray[1].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string user = sArray[2].ToString();//ç¨æ·å |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); //å表 |
| | | string refSav = sArray[2].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string user = sArray[3].ToString();//ç¨æ·å |
| | | |
| | | |
| | | string UserName = ""; |
| | | string s = ""; |
| | |
| | | } |
| | | UserName = oItem.HMaker; //å¶å人 |
| | | oItem.HBillType = "7523"; |
| | | oItem.HBillSubType = "7523"; |
| | | |
| | | |
| | | |
| | | //oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | //oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | oItem.HBillSubType = "7523"; |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | |
| | | // è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | string jsonString1 = "[" + msg3.ToString() + "]"; |
| | | List<ClsQC_MonthTarGetBillSub> ls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_MonthTarGetBillSub>>(jsonString1); |
| | | int i = 0; |
| | | foreach (Model.ClsQC_MonthTarGetBillSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | |
| | | |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | |
| | | } |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From QC_MonthTarGetBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_MonthTarGetBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½(å 载表ç¨) |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | #region è´¨éæåº¦ç®æ å ç¼è¾åæ¾ |
| | | [Route("QC_MonthTarGetBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_QC_MonthTarGetBillList where hmainid =" + HInterID, "h_v_QC_MonthTarGetBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_QC_MonthTarGetBill_Edit where hmainid =" + HInterID, "h_v_QC_MonthTarGetBill_Edit"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |