public object DeleteModule(ModuleParam MP) { try { TblModuleMaster objmodule = db.TblModuleMasters.Where(r => r.ModuleId == MP.ModuleId).FirstOrDefault(); if (objmodule.Status == 1) { objmodule.Status = 0; } else { objmodule.Status = 1; } db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Module Updated Successfully!" }); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public object DeleteMenu(ModuleParam PM) { try { TblModuleMaster obGR = db.TblModuleMasters.Where(r => r.ModuleId == PM.ModuleId).FirstOrDefault(); if (obGR.Status == 1) { obGR.Status = 0; } else { obGR.Status = 1; } db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Menu Deactivated Successfully." }); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object SaveModule(ModuleParam MP) { try { string msg = ""; if (MP.BtnStatus == "Save") { var usercode = db.TblModuleMasters.Where(r => r.ModuleName == MP.ModuleName.ToUpper()).FirstOrDefault(); if (usercode != null) { return(new Error() { IsError = true, Message = "Module Name Already Exists!" }); } TblModuleMaster objModule = new TblModuleMaster(); objModule.ModuleName = MP.ModuleName.ToUpper(); objModule.ModuleOrder = MP.ModuleOrder; objModule.CreatedBy = MP.CreatedBy; objModule.CreatedDate = DateTime.Now; objModule.ParentModuleId = 0; objModule.Status = 1; db.TblModuleMasters.Add(objModule); db.SaveChanges(); msg = "Module Saved Successfully!"; } else { TblModuleMaster objModule = db.TblModuleMasters.Where(r => r.ModuleId == MP.ModuleId).FirstOrDefault(); objModule.ModuleName = MP.ModuleName.ToUpper(); objModule.ModuleOrder = MP.ModuleOrder; objModule.ModifiedDate = DateTime.Now; objModule.ModuleId = MP.ModuleId; db.SaveChanges(); msg = "Module Updated Successfully!"; } return(new Result() { IsSucess = true, ResultData = msg }); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
public object DeleteMenu([FromBody] ModuleParam PM) { try { ModuleMasterBL MB = new ModuleMasterBL(); var Result = MB.DeleteMenu(PM); return Result; } catch (Exception e) { return new Error() { IsError = true, Message = e.Message }; } }
public object GetMenuUnderModule([FromBody] ModuleParam P) { try { ModuleMasterBL obj = new ModuleMasterBL(); var result = obj.GetModuleWiseMenu(P); return result; } catch (Exception ex) { return new Error() { IsError = true, Message = ex.Message }; } }
public object GetSingleModuleInfo([FromBody]ModuleParam OBJGR) { try { CreateModuleBL obj = new CreateModuleBL(); var SingleGR = obj.GetSingleModule(OBJGR); return SingleGR; } catch (Exception ex) { return new Error() { IsError = true, Message = ex.Message }; } }
public object SaveModule([FromBody] ModuleParam PR) { try { CreateModuleBL OBJSAVE = new CreateModuleBL(); var result = OBJSAVE.SaveModule(PR); return result; } catch (Exception e) { return new Error() { IsError = true, Message = e.Message }; } }
public object DeleteModule([FromBody] ModuleParam MP) { try { CreateModuleBL obj = new CreateModuleBL(); var result = obj.DeleteModule(MP); return result; } catch (Exception e) { return new Error() { IsError = true, Message = e.Message }; } }
public object GetChildMenuName([FromBody]ModuleParam M) { try { ModuleMasterBL obj = new ModuleMasterBL(); var result = obj.GetMenuNames(M); return result; } catch(Exception e) { return new Error() { IsError = true, Message = e.Message }; } }
//public object GetModuleMaster([FromBody]ModuleParam objid) public object GetModuleMaster([FromBody]ModuleParam objid) { try { var status = objid.Status; CreateModuleBL obj = new CreateModuleBL(); var ERPModule = obj.GetModuleList(status); return ERPModule; } catch (Exception ex) { return new Error() { IsError = true, Message = ex.Message }; } }
public object GetSingleModule(ModuleParam objgr) { try { var SingleModulelist = db.ViewModuleMasters.Where(r => r.ModuleId == objgr.ModuleId).FirstOrDefault(); return(SingleModulelist); } catch (Exception E) { return(new Error() { IsError = true, Message = E.Message }); } }
public object SaveUpdate([FromBody] ModuleParam PM) { try { ModuleMasterBL MB = new ModuleMasterBL(); var Result = MB.SaveMenu(PM); return(Result); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object GetSingleMenu([FromBody] ModuleParam MP) { try { ModuleMasterBL obj = new ModuleMasterBL(); var result = obj.GetSingleMenuBL(MP); return(result); } catch (Exception ex) { return(new Error() { IsError = true, Message = ex.Message }); } }
/// <summary> /// 获取选项数据 /// </summary> /// <param name="key">选项代码</param> /// <param name="deptId">部门ID</param> /// <param name="userId">用户ID</param> /// <returns>ModuleParam 选项数据</returns> public ModuleParam GetParam(string key, string deptId = null, string userId = null) { var param = moduleParams.FirstOrDefault(i => i.code == key && i.deptId == deptId && i.userId == userId); if (param == null) { param = new ModuleParam { id = Util.NewId(), moduleId = moduleId, code = key, deptId = deptId, userId = userId }; moduleParams.Add(param); } return(param); }
/// <summary> /// 获取选项数据 /// </summary> /// <param name="key">选项代码</param> /// <param name="deptId">部门ID</param> /// <param name="userId">用户ID</param> /// <param name="moduleId">模块ID</param> /// <returns>ModuleParam 选项数据</returns> protected ModuleParam getParam(string key, string deptId = null, string userId = null, string moduleId = null) { var param = moduleParams.FirstOrDefault(i => i.deptId == deptId && i.creatorId == userId && i.code == key && (string.IsNullOrEmpty(moduleId) || i.moduleId == moduleId)); if (param != null) { return(param); } param = new ModuleParam { id = Util.newId(), moduleId = moduleId, code = key, deptId = deptId, creatorId = userId }; moduleParams.Add(param); return(param); }
public object GetSingleMenuBL(ModuleParam Param) { try { var res = db.TblModuleMasters.Where(r => r.ModuleId == Param.ModuleId).FirstOrDefault(); if (res == null) { return(new Error() { IsError = true, Message = "No Records Found !!" }); } return(res); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public object GetModuleWiseMenu(ModuleParam obj) { try { /// ParentModuleId=0 is Module.Hence the menus do not have parentid=0 var MenuList = db.TblModuleMasters.Where(r => r.Status == 1 && r.ParentModuleId == obj.ParentMenuId).ToList(); if (MenuList == null) { return(new Error() { IsError = true, Message = "No Records Found !!" }); } return(MenuList); } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }
public FileParser(LangMatcher langMatcher, Lang lang, string path, string relPath) { this.langMatcher = langMatcher; this.lang = lang; this.path = path; this.relPath = relPath; paramMatcher = new ParamMatcher(lang); Lines = File.ReadAllLines(path); // Load each line of the file in the buffer ModuleParam moduleParam = new ModuleParam(); // adds a new wrapper with default "none" data // initialize wrapper list WrapperDict = new SortedDictionary <string, WrapperParam> { { moduleParam.WrapperName, moduleParam } }; // initializes the current vars for easy and fast access CurrentWrapper = moduleParam; CurrentSection = CurrentWrapper.GetSectionNone(); }
public object SaveMenu(ModuleParam PM) { try { if (PM.BtnStatus == "Save") { if (PM.ModuleName == null) { return(new Error() { IsError = true, Message = "Please Enter Menu Name !!" }); } TblModuleMaster objuser = new TblModuleMaster(); var result = db.TblModuleMasters.FirstOrDefault(r => r.ModuleName == PM.ModuleName.ToUpper()); if (result != null) { return(new Error() { IsError = true, Message = "Menu with Same Name Already Exists !!" }); } if (PM.ParentMenuId == 0) { objuser.ParentModuleId = PM.ModuleId; } else { objuser.ParentModuleId = PM.ParentMenuId; } objuser.ModuleName = PM.ModuleName.ToUpper(); objuser.ModuleOrder = Convert.ToInt64(PM.ModuleOrder); objuser.Status = 1; objuser.ActionName = PM.ActionName; objuser.CreatedDate = DateTime.Now; db.TblModuleMasters.Add(objuser); db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Menu Added Successfully." }); } else { TblModuleMaster obGR = db.TblModuleMasters.Where(r => r.ModuleId == PM.ModuleId).FirstOrDefault(); obGR.ModuleName = PM.ModuleName; obGR.ParentModuleId = PM.ParentMenuId; obGR.ModuleOrder = Convert.ToInt64(PM.ModuleOrder); obGR.ActionName = PM.ActionName; obGR.ModifiedBy = PM.ModifiedBy; obGR.ModifiedDate = DateTime.Now; db.SaveChanges(); return(new Result() { IsSucess = true, ResultData = "Menu Updated Successfully." }); } } catch (Exception e) { return(new Error() { IsError = true, Message = e.Message }); } }