| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  | using FineUIPro; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace BLL | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |     public static class InterFaceSetService | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |     { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |         #region 获取列表 | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 记录数 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public static int count | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get; | 
					
						
							|  |  |  |  |             set; | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |         public static List<Model.InterFaceSet> GetInterFaceSetByModle(Model.InterFaceSet table) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var q = from x in Funs.DB.InterFaceSet | 
					
						
							|  |  |  |  |                     where | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.InterFaceSetId) || x.InterFaceSetId.Contains(table.InterFaceSetId)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.InterFaceName) || x.InterFaceName.Contains(table.InterFaceName)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.InterFaceUrl) || x.InterFaceUrl.Contains(table.InterFaceUrl)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.AuthUnitIds) || x.AuthUnitIds.Contains(table.AuthUnitIds)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.AuthUnitName) || x.AuthUnitName.Contains(table.AuthUnitName)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.ValidPeriod) || x.ValidPeriod.Contains(table.ValidPeriod)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.TxtRemarks) || x.TxtRemarks.Contains(table.TxtRemarks)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.InterFaceForUrl) || x.InterFaceForUrl.Contains(table.InterFaceForUrl)) && | 
					
						
							|  |  |  |  |                               (string.IsNullOrEmpty(table.InterFaceCallBackUrl) || x.InterFaceCallBackUrl.Contains(table.InterFaceCallBackUrl)) | 
					
						
							|  |  |  |  |                     select x | 
					
						
							|  |  |  |  |                   ; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             return q.ToList(); | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// 获取分页列表 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="PageIndex">页码</param> | 
					
						
							|  |  |  |  |         /// <param name="PageSize">每页数量</param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public static IEnumerable getListData(Model.InterFaceSet table, Grid Grid1) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |             var q = GetInterFaceSetByModle(table); | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |             count = q.Count(); | 
					
						
							|  |  |  |  |             if (count == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return null; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             //  q=  q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList(); | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |             // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |             return from x in q | 
					
						
							|  |  |  |  |                    select new | 
					
						
							|  |  |  |  |                    { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                        x.InterFaceSetId, | 
					
						
							|  |  |  |  |                        x.InterFaceName, | 
					
						
							|  |  |  |  |                        x.InterFaceUrl, | 
					
						
							|  |  |  |  |                        x.UnitId, | 
					
						
							|  |  |  |  |                        x.AuthUnitIds, | 
					
						
							|  |  |  |  |                        x.AuthUnitName, | 
					
						
							|  |  |  |  |                        x.IsOpen, | 
					
						
							|  |  |  |  |                        x.ValidPeriod, | 
					
						
							|  |  |  |  |                        x.TxtRemarks, | 
					
						
							|  |  |  |  |                        x.InterFaceForUrl, | 
					
						
							|  |  |  |  |                        x.IsCallBack, | 
					
						
							|  |  |  |  |                        x.InterFaceCallBackUrl, | 
					
						
							|  |  |  |  |                        x.UrlReqMethod, | 
					
						
							|  |  |  |  |                        x.CallBackUrlReqMethod, | 
					
						
							|  |  |  |  |                        x.ForUrlReqMethod | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |                    }; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |         public static Model.InterFaceSet GetInterFaceSetById(string InterFaceSetId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             return Funs.DB.InterFaceSet.FirstOrDefault(x => x.InterFaceSetId == InterFaceSetId); | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |         public static List<Model.InterFaceSet> GetInterFaceSets() | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |             var q = (from x in Funs.DB.InterFaceSet select x).ToList(); | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |             return q; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public static void AddInterFaceSet(Model.InterFaceSet newtable) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             Model.InterFaceSet table = new Model.InterFaceSet | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 InterFaceSetId = newtable.InterFaceSetId, | 
					
						
							|  |  |  |  |                 InterFaceName = newtable.InterFaceName, | 
					
						
							|  |  |  |  |                 InterFaceUrl = newtable.InterFaceUrl, | 
					
						
							|  |  |  |  |                 UnitId = newtable.UnitId, | 
					
						
							|  |  |  |  |                 AuthUnitIds = newtable.AuthUnitIds, | 
					
						
							|  |  |  |  |                 AuthUnitName = newtable.AuthUnitName, | 
					
						
							|  |  |  |  |                 IsOpen = newtable.IsOpen, | 
					
						
							|  |  |  |  |                 ValidPeriod = newtable.ValidPeriod, | 
					
						
							|  |  |  |  |                 TxtRemarks = newtable.TxtRemarks, | 
					
						
							|  |  |  |  |                 InterFaceForUrl = newtable.InterFaceForUrl, | 
					
						
							|  |  |  |  |                 IsCallBack = newtable.IsCallBack, | 
					
						
							|  |  |  |  |                 InterFaceCallBackUrl = newtable.InterFaceCallBackUrl, | 
					
						
							|  |  |  |  |                 UrlReqMethod = newtable.UrlReqMethod, | 
					
						
							|  |  |  |  |                 ForUrlReqMethod = newtable.ForUrlReqMethod, | 
					
						
							|  |  |  |  |                 CallBackUrlReqMethod = newtable.CallBackUrlReqMethod, | 
					
						
							|  |  |  |  |                 IsSingleRequest = newtable.IsSingleRequest, | 
					
						
							|  |  |  |  |                 RequestJsonBody = newtable.RequestJsonBody, | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |             }; | 
					
						
							|  |  |  |  |             Funs.DB.InterFaceSet.InsertOnSubmit(table); | 
					
						
							|  |  |  |  |             Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         public static void UpdateInterFaceSet(Model.InterFaceSet newtable) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             Model.InterFaceSet table = Funs.DB.InterFaceSet.FirstOrDefault(x => x.InterFaceSetId == newtable.InterFaceSetId); | 
					
						
							|  |  |  |  |             if (table != null) | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |                 table.InterFaceSetId = newtable.InterFaceSetId; | 
					
						
							|  |  |  |  |                 table.InterFaceName = newtable.InterFaceName; | 
					
						
							|  |  |  |  |                 table.InterFaceUrl = newtable.InterFaceUrl; | 
					
						
							|  |  |  |  |                 table.UnitId = newtable.UnitId; | 
					
						
							|  |  |  |  |                 table.AuthUnitIds = newtable.AuthUnitIds; | 
					
						
							|  |  |  |  |                 table.AuthUnitName = newtable.AuthUnitName; | 
					
						
							|  |  |  |  |                 table.IsOpen = newtable.IsOpen; | 
					
						
							|  |  |  |  |                 table.ValidPeriod = newtable.ValidPeriod; | 
					
						
							|  |  |  |  |                 table.TxtRemarks = newtable.TxtRemarks; | 
					
						
							|  |  |  |  |                 table.InterFaceForUrl = newtable.InterFaceForUrl; | 
					
						
							|  |  |  |  |                 table.IsCallBack = newtable.IsCallBack; | 
					
						
							|  |  |  |  |                 table.InterFaceCallBackUrl = newtable.InterFaceCallBackUrl; | 
					
						
							|  |  |  |  |                 table.UrlReqMethod = newtable.UrlReqMethod; | 
					
						
							|  |  |  |  |                 table.ForUrlReqMethod = newtable.ForUrlReqMethod; | 
					
						
							|  |  |  |  |                 table.CallBackUrlReqMethod = newtable.CallBackUrlReqMethod; | 
					
						
							|  |  |  |  |                 table.IsSingleRequest = newtable.IsSingleRequest; | 
					
						
							|  |  |  |  |                 table.RequestJsonBody = newtable.RequestJsonBody; | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |                 Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |         public static void DeleteInterFaceSetById(string InterFaceSetId) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             Model.InterFaceSet table = Funs.DB.InterFaceSet.FirstOrDefault(x => x.InterFaceSetId == InterFaceSetId); | 
					
						
							|  |  |  |  |             if (table != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |                 Funs.DB.InterFaceSet.DeleteOnSubmit(table); | 
					
						
							|  |  |  |  |                 Funs.DB.SubmitChanges(); | 
					
						
							| 
									
										
										
										
											2025-03-13 10:52:32 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-10 11:40:02 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         public static void InitInterFaceDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             dropName.DataValueField = "InterFaceSetId"; | 
					
						
							|  |  |  |  |             dropName.DataTextField = "InterFaceName"; | 
					
						
							|  |  |  |  |             dropName.DataSource = GetInterFaceSets(); | 
					
						
							|  |  |  |  |             dropName.DataBind(); | 
					
						
							|  |  |  |  |             if (isShowPlease) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(dropName); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         public static ListItem[] GetReqMethod() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             ListItem[] listItem = new ListItem[2]; | 
					
						
							|  |  |  |  |             listItem[0] = new ListItem("Get", "Get"); | 
					
						
							|  |  |  |  |             listItem[1] = new ListItem("Post", "Post"); | 
					
						
							|  |  |  |  |             return listItem; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         public static void InitReqMethodDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             dropName.DataValueField = "Value"; | 
					
						
							|  |  |  |  |             dropName.DataTextField = "Text"; | 
					
						
							|  |  |  |  |             dropName.DataSource = GetReqMethod(); | 
					
						
							|  |  |  |  |             dropName.DataBind(); | 
					
						
							|  |  |  |  |             if (isShowPlease) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Funs.FineUIPleaseSelect(dropName); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |