| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //å®ä¹å£°æåé ï¼æéè¿ new List<object>()å建ç å®ä¾ï¼èµå¼ç»åé |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_KF_BarCodeStatusChangeBillList order by HMainID asc", "h_v_KF_BarCodeStatusChangeBillList"); |
| | |
| | | string sql = sql1 + sWhere + " order by HMainID asc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_KF_BarCodeStatusChangeBillList"); |
| | | } |
| | | foreach (DataColumn col in ds.Tables[0].Columns)//éådsä¸ç¬¬ä¸ä¸ªè¡¨ï¼Tables[0]ï¼çææåï¼Columnsï¼æ¯æ¬¡å¾ªç¯ä¸ï¼colåé伿æå½ååçå¼ç¨ |
| | | { |
| | | Type dataType = col.DataType; //è·åå½åæ°æ®ç±»åä¼ å
¥ èªå®ä¹åédatadataType |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //åç¬¦ä¸²æ¼æ¥ // å°åååæ°æ®ç±»åä¿¡æ¯æ¼æ¥æä¸ä¸ªJSONæ ¼å¼çå符串 |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.data = ds.Tables[0];//代ç å°ç¬¬ä¸ä¸ªDataTableï¼ç´¢å¼ä¸º0ï¼èµå¼ç»objJsonResultçdata屿§ |
| | | objJsonResult.list = columnNameList;//å°columnNameListèµå¼ç»objJsonResultçlist屿§ |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | |
| | | |
| | | //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.Message = s; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POOrderBillList"); |
| | | |
| | |
| | | oCN.RunProc("update KF_BarCodeStatusChangeBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HBillStatus=" + HBillStatus + |
| | | ",HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID); |
| | | |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from KF_BarCodeStatusChangeBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType, HMaker); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType) |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType,string user) |
| | | { |
| | | List<ClsKF_BarCodeStatusChangeBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKF_BarCodeStatusChangeBillSub>>(msg3); |
| | | |
| | |
| | | ,HRelationMoney,HBarCode,HBarCodeStatus_Old,HBarCodeStatus_New,HAuxPropID_Old,HAuxPropID_New,HMTONo_Old,HMTONo_New) |
| | | values({HInterID},{NewHEntryID},'{oSub.HBillNo_bak}','{oSub.HRemark}',{oSub.HSourceInterID} |
| | | ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},'{oSub.HBarCode}','{oSub.HBarCodeStatus_Old}','{oSub.HBarCodeStatus_New}','{oSub.HAuxPropID_Old}','{oSub.HAuxPropID_New}','{oSub.HMTONo_Old}','{oSub.HMTONo_New}')"); |
| | | oCN.RunProc("update Gy_BarCodeBill set " + |
| | | "HBarCodeStatus='" + oSub.HBarCodeStatus_New + "', HStatusMan='" + user + "'," + " HStatusDate=getdate()" + " where HBarCode='" + oSub.HBarCode+"'"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | |
| | | { |
| | | try |
| | | { |
| | | //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | DateTime HDate = DateTime.Now; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.Message = s; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From KF_BarCodeStatusChangeBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From KF_BarCodeStatusChangeBillSub where HInterID = " + HInterID); |