LMES/obj/x86/Release/LMES.csprojAssemblyReference.cache | 补丁 | 查看 | 原始文档 | blame | 历史 | |
LMES/obj/x86/Release/build.force | 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/obj/x86/Release/Model.csprojAssemblyReference.cache | 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/obj/x86/Release/build.force | 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/WebAPIController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/Menu.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ModelConvertHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Models/ToHierarchy.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WorkM/流转卡管理/Sc_ProcessExchangeBillQuery.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
LMES/obj/x86/Release/LMES.csprojAssemblyReference.cacheBinary files differ
LMES/obj/x86/Release/build.force
Model/obj/x86/Release/Model.csprojAssemblyReference.cacheBinary files differ
Model/obj/x86/Release/build.force
WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
@@ -162,36 +162,39 @@ } //é ä»¶è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã msg4 = msg4.Substring(1, msg4.Length - 2); msg4 = msg4.Replace("\\", ""); msg4 = msg4.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSb_EquipMaintainBillSub> ls1 = new List<Model.ClsSb_EquipMaintainBillSub>(); ls1 = oListModels.getObjectByJson_Sb_EquipMaintainBillSub(msg4); int j = 0; foreach (Model.ClsSb_EquipMaintainBillSub oItemSub in ls1) if (msg4 != "undefined" && msg4 != "" && msg4 != "[]") { msg4 = msg4.Substring(1, msg4.Length - 2); msg4 = msg4.Replace("\\", ""); msg4 = msg4.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSb_EquipMaintainBillSub> ls1 = new List<Model.ClsSb_EquipMaintainBillSub>(); ls1 = oListModels.getObjectByJson_Sb_EquipMaintainBillSub(msg4); int j = 0; foreach (Model.ClsSb_EquipMaintainBillSub oItemSub in ls1) { j++; oItemSub.HEntryID = i; //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //HMaterID = "";//é 件代ç //HUnitID = "";//åä½ä»£ç //HQty = "";//å®é ç¨é //HQtyMust = "";//åä½ç¨é //HRemark = "";//夿³¨ j++; oItemSub.HEntryID = i; //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //HMaterID = "";//é 件代ç //HUnitID = "";//åä½ä»£ç //HQty = "";//å®é ç¨é //HQtyMust = "";//åä½ç¨é //HRemark = "";//夿³¨ oBill.DetailColl.Add(oItemSub); oBill.DetailColl.Add(oItemSub); } } //ä¿å //ä¿å宿¯åå¤ç WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
@@ -157,36 +157,39 @@ } //é ä»¶é¡¹è¡¨ä½æ°æ® //æ },{æ¥æåæ°ç» //廿ãåã msg4 = msg4.Substring(1, msg4.Length - 2); msg4 = msg4.Replace("\\", ""); msg4 = msg4.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSb_EquipMaintainPlanBillSub> ls1 = new List<Model.ClsSb_EquipMaintainPlanBillSub>(); ls1 = oListModels.getObjectByJson_Sb_EquipMaintainPlanBillSub(msg4); int j = 0; foreach (Model.ClsSb_EquipMaintainPlanBillSub oItemSub in ls1) if (msg4 != "undefined" && msg4 != "" && msg4 != "[]") { msg4 = msg4.Substring(1, msg4.Length - 2); msg4 = msg4.Replace("\\", ""); msg4 = msg4.Replace("\n", ""); //\n //msg2 = msg2.Replace("'", "â"); List<Model.ClsSb_EquipMaintainPlanBillSub> ls1 = new List<Model.ClsSb_EquipMaintainPlanBillSub>(); ls1 = oListModels.getObjectByJson_Sb_EquipMaintainPlanBillSub(msg4); int j = 0; foreach (Model.ClsSb_EquipMaintainPlanBillSub oItemSub in ls1) { j++; oItemSub.HEntryID = j; //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //HMaterID = "";//é 件代ç //HUnitID = "";//åä½ä»£ç //HQty = "";//å®é ç¨é //HQtyMust = "";//åä½ç¨é //HRemark = "";//夿³¨ j++; oItemSub.HEntryID = j; //oItemSub.HCloseMan = ""; //è¡å ³é oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //å ³éç±»å //oItemSub.HRemark = ""; //夿³¨ oItemSub.HSourceInterID = 0; // æºå主å ç oItemSub.HSourceEntryID = 0; //æºååå ç //oItemSub.HSourceBillNo = ""; //æºååå· //oItemSub.HSourceBillType = ""; //æºåç±»å oItemSub.HRelationQty = 0; //å ³èæ°é //oItemSub.HRelationMoney = 0; //å ³èéé¢ //HMaterID = "";//é 件代ç //HUnitID = "";//åä½ä»£ç //HQty = "";//å®é ç¨é //HQtyMust = "";//åä½ç¨é //HRemark = "";//夿³¨ oBill.DetailColl.Add(oItemSub); oBill.DetailColl.Add(oItemSub); } } //ä¿å //ä¿å宿¯åå¤ç WebAPI/Controllers/WebAPIController.cs
@@ -1,6 +1,8 @@ using DAL; using DBUtility; using Model; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using SQLHelper; using System; @@ -2195,6 +2197,55 @@ } } #region [æ¥è¯¢èåå表] [Route("Web/MenuList")] [HttpGet] public object MenuList() { try { List<Menu> mu = new List<Menu>(); SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); ds = oCn.RunProcReturn("Select * from Gy_Menu Order by HItemID ", "Gy_Menu"); //List<Menu> mu1 = ds.Tables[0].AsEnumerable().Select(t => new Menu()).ToList(); //List<Menu> users = ModelConvertHelper<Menu>.ConvertToModel(ds.Tables[0]); //var dd = ToHierarchy.ToHierarchyList(users); //string json = JsonConvert.SerializeObject(dd); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //è¿éæ¯å¾ªç¯ææ { if (ds.Tables[0].Rows[i]["HPartentID"].ToString()=="0" || ds.Tables[0].Rows[i]["HitemID"].ToString() == ds.Tables[0].Rows[i]["HPartentID"].ToString()) //夿æ¯å¦æå¤å±æ ¹èç¹ { Menu tbj = new Menu(); tbj.HitemID = ds.Tables[0].Rows[i]["HitemID"].ToString(); tbj.HNumber = ds.Tables[0].Rows[i]["HNumber"].ToString(); tbj.HName = ds.Tables[0].Rows[i]["HName"].ToString(); tbj.HPartentID =ds.Tables[0].Rows[i]["HPartentID"].ToString(); tbj.HLevel = int.Parse(ds.Tables[0].Rows[i]["HLevel"].ToString()); tbj.Hurl = ds.Tables[0].Rows[i]["Hurl"].ToString(); mu.Add(tbj); } } ToHierarchy.digui(ds.Tables[0], mu); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å 餿åï¼"; objJsonResult.data =Newtonsoft.Json.JsonConvert.SerializeObject(mu); return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å é¤å¤±è´¥ï¼"; objJsonResult.data = e.ToString(); return objJsonResult; } } #endregion } } WebAPI/Models/Menu.cs
New file @@ -0,0 +1,20 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebAPI.Models { public class Menu { //public int HitemID { get; set; } public string HitemID { get; set; } //public int? HPartentID { get; set; } public string HPartentID { get; set; } public string HNumber { get; set; } public string HName { get; set; } public int HLevel { get; set; } public string Hurl { get; set; } public List<Menu> childMenus { get; set; } } } WebAPI/Models/ModelConvertHelper.cs
New file @@ -0,0 +1,45 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Reflection; using System.Web; namespace WebAPI.Models { public class ModelConvertHelper<T> where T : new() { public static List<T> ConvertToModel(DataTable dt) { // å®ä¹éå List<T> ts = new List<T>(); // è·å¾æ¤æ¨¡åçç±»å Type type = typeof(T); string tempName = ""; foreach (DataRow dr in dt.Rows) { T t = new T(); // è·å¾æ¤æ¨¡åçå ¬å ±å±æ§ PropertyInfo[] propertys = t.GetType().GetProperties(); foreach (PropertyInfo pi in propertys) { tempName = pi.Name; // æ£æ¥DataTableæ¯å¦å 嫿¤å if (dt.Columns.Contains(tempName)) { // 夿æ¤å±æ§æ¯å¦æSetter if (!pi.CanWrite) continue; object value = dr[tempName]; if (value != DBNull.Value) pi.SetValue(t, value, null); } } ts.Add(t); } return ts; } } } WebAPI/Models/ToHierarchy.cs
New file @@ -0,0 +1,50 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Web; namespace WebAPI.Models { public class ToHierarchy { public static List<Menu> ToHierarchyList(List<Menu> limits, string HPartentID/*int? HPartentID = 0*/) { List<Menu> newLimitList = new List<Menu>(); newLimitList = limits.Where(t => t.HPartentID == HPartentID).ToList(); for (int i = 0; i < newLimitList.Count; i++) { newLimitList[i].childMenus = ToHierarchyList(limits, newLimitList[i].HPartentID);//ä¸ä¸å±çº§ } return newLimitList; } public static void digui(DataTable dt, List<Menu> tree) { for (int m = 0; m < tree.Count; m++) { tree[m].childMenus = new List<Menu>(); for (int i = 0; i < dt.Rows.Count; i++)//ç¬¬ä¸æ¬¡å¾ªç¯ï¼å¾å°æææ ¹èç¹çåé { if (tree[m].HitemID.ToString() == dt.Rows[i]["HPartentID"].ToString() && dt.Rows[i]["HitemID"].ToString() != dt.Rows[i]["HPartentID"].ToString()) { Menu tbjson = new Menu(); tbjson.HitemID = dt.Rows[i]["HitemID"].ToString(); tbjson.HPartentID = dt.Rows[i]["HPartentID"].ToString(); tbjson.HNumber = dt.Rows[i]["HNumber"].ToString(); tbjson.HName = dt.Rows[i]["HName"].ToString(); tbjson.HLevel = tree[m].HLevel; tbjson.Hurl = dt.Rows[i]["Hurl"].ToString(); tree[m].childMenus.Add(tbjson); } } for (int i = 0; i < tree[m].childMenus.Count; i++) { digui(dt, tree[m].childMenus);//忬¡ç¨åéå»å¾ªç¯ï¼æ¿åºåéçåé } } } } } WebAPI/WebAPI.csproj
@@ -437,12 +437,15 @@ <Compile Include="Models\ClsSc_MouldRepairOutBillMain.cs" /> <Compile Include="Models\ClsSc_MouldRepairOutBillSub.cs" /> <Compile Include="Models\ClsGy_ProcPrice.cs" /> <Compile Include="Models\Menu.cs" /> <Compile Include="Models\ModelConvertHelper.cs" /> <Compile Include="Models\Pay_OtherBalBill.cs" /> <Compile Include="Models\Pay_WorkTimesBillSub.cs" /> <Compile Include="Models\Pay_WorkTimesBill.cs" /> <Compile Include="Models\Pay_SingleBalBill.cs" /> <Compile Include="Models\Pay_OtherBalBillSub.cs" /> <Compile Include="Models\Pay_SingleBalBillSub.cs" /> <Compile Include="Models\ToHierarchy.cs" /> <Compile Include="Models\Xt_ORGANIZATIONS.cs" /> <Compile Include="Models\ClsSb_EquipRepairWorkBillSub.cs" /> <Compile Include="Models\ClsSc_ICMOBillWorkQtyStatus_Tmp.cs" /> WorkM/Á÷ת¿¨¹ÜÀí/Sc_ProcessExchangeBillQuery.cs
@@ -1168,6 +1168,10 @@ private void cf_Click(object sender, EventArgs e) { //æºè§ç¹å«æ§å¶ MessageBox.Show("åæ®æååè½å·²æ§å¶ï¼è¯·ä¸ç®¡çåèç³»", "æç¤º"); return; // Int64 lngBillKey = 0; if (grdMain.CurrentRow == null) return;