The ordering of modules (menus) is a function that every system must have, and the ordering of our framework modules is already reflected in the business logic.
The WinForm version can sort the modules directly on the interface to control the order in which the modules are presented. The web version in version 3.2 also added a direct module management interface to the module to sort the user-friendly operation, greatly facilitate the management staff. The sorting of the modules is shown on the right side of the module management main interface paging button.
Three button functions: Move up, move down, confirm changes
Webmvc section, module sorting function code reference:
<summary>///Save module sorting function///</summary>//<param name= "ParentID" > Parent node </ param>//<param name= "Rows" > Data lines </param>//<returns></returns> [Httppos T] [ValidateInput (false)] [loginauthorize] public virtual ActionResult savesort (String Parentid,strin G rows) {string message = rdiframeworkmessage.msg0001; try {if (! IsAuthorized ("Modulemanagement.edit")) {return Content (new Jsonmessage {Success = Fals E, Data = "0", Message = "You do not have permission to operate!" " }. ToString ()); } int returnupdatevalue = 0; RDIFramework.Utilities.UserInfo Curuser = ManageProvider.Provider.Current (); if (!string. IsNullOrEmpty (ParentID)) {var dtmodule = RDIFrameworkService.Instance.ModuleService.Get Dtbyparent (Curuser, parEntid); var moduleoldsort = new list<keyvaluepair<string, object>> (); if (dtmodule! = null && dtModule.Rows.Count > 0) {moduleoldsort.addr Ange (from DataRow row in Dtmodule.rows select Baseentity.create<pimoduleentity> (Row) to moduleentity select New K Eyvaluepair<string, Object> (Moduleentity.id, Moduleentity.sortcode)); } var modulenewsort = new list<keyvaluepair<string, object>> (); Convert a JSON string to an object list<pimoduleentity> listRows = rows?. Jonstolist<pimoduleentity> (); if (listRows! = null && listrows.count > 0) {modulenewsort.addrange ( Listrows.select (entity = new keyvaluepair<string, object> (entity. ID, entity. (Sortcode))); } if (Modulenewsort.count > 0 &Amp;& moduleoldsort.count > 0 && modulenewsort.count = = Moduleoldsort.count) { for (int index = 0; index < moduleoldsort.count; index++) { Moduleoldsort[index] = Modulenewsort[index]; } foreach (Var parelement in moduleoldsort) {PiM Oduleentity updateentity = RDIFrameworkService.Instance.ModuleService.GetEntity (Curuser,parelement.key); if (Updateentity.sortcode! = NULL && Parelement.value! = null &&!updateentity.sortcode.equals ( Businesslogic.converttoint32 (Parelement.value)) {updateentity. Sortcode = Businesslogic.converttoint32 (Parelement.value); String StatusCode; String StatusMessage; RdifRameworkService.Instance.ModuleService.Update (Curuser, updateentity, out Statuscode,out StatusMessage); Returnupdatevalue + = StatusCode = = RDIFramework.Utilities.StatusCode.OKUpdate.ToString ()? 1:0; }} if (Returnupdatevalue > 0) { message = "Action tip:" + "<br> sort saved successfully, update data:" + returnupdatevalue.tostring () + "bar. "; Return Content (new Jsonmessage {Success = true, Data = "1", message = message}. ToString ()); } message = "Action tip:" + "<br> no sort data was modified. "; Return Content (new Jsonmessage {Success = true, Data = "1", message = message}. ToString ()); message = "Action tip:" + "<br> the current operation's record condition does not match the original record condition. "; Return Content (new Jsonmessage {Success = false, Data = "0", message = message}. ToString ()); } message = "Action tip:" + "<br> Select a parent node to operate. "; Return Content (new Jsonmessage {Success = false, Data = "0", message = message}. ToString ()); } catch (Exception ex) {return Content (new Jsonmessage {Success = false, Data = "0" , Message = "operation failed:" + ex. Message}. ToString ()); } }
Related articles:
rdiframework Platform Code generator V3.2 release version
rdiframework.net-based on. NET rapid Information System development Framework-Series catalogue
Rdiframework.net━.net Rapid Information System Development framework- Introduction to Workflow Components
For a few years, thanks to the supporters and users of the rdiframework.net framework, you can find out more at the address below.
rdiframework.net official website:http://www.rdiframework.net/
rdiframework.net Official blog:http://blog.rdiframework.net/
At the same time need to be explained, all the technical articles in the future to the official website as the subject, welcome to our collection!
rdiframework.net Framework by the professional team for a long time to build, has been updated, has been upgrading, please rest assured that use!
Welcome to Rdiframework.net Framework Official public (No.:rdiframework-net), keep abreast of the latest developments.
Scan QR code for immediate attention
Rdiframework.net━. NET rapid Information System Development Framework V3.2->web version Module management interface new module sorting function