public object EnableDisablePermission(PermissionsWithRoleID r) { String msg = " "; try { bool rowdeleted = DataService.EnableDisablePermission(r.Id, r.IsActive, DateTime.UtcNow, SessionManager.CurrentUser.UserId); if (rowdeleted == true) { var param = (r.IsActive == false ? "disabled" : "enabled"); msg = String.Format("Permission is {0} successfully", param); } else { msg = " "; } return(new { success = true, error = msg }); } catch (Exception ex) { return(new { success = false, error = "Some Error has occurred" }); } }
public int SavePermission(PermissionsWithRoleID per, DateTime pActivityTime, int pActivityBy) { using (var ctx = new PRMDataContext()) { string query = "execute sec.SavePermission @0, @1,@2,@3,@4"; var args = new DbParameter[] { new SqlParameter { ParameterName = "@0", Value = per.Id }, new SqlParameter { ParameterName = "@1", Value = per.Name }, new SqlParameter { ParameterName = "@2", Value = per.Description }, new SqlParameter { ParameterName = "@3", Value = pActivityTime.YYYYMMDD() }, new SqlParameter { ParameterName = "@4", Value = pActivityBy } }; var data = ctx.Database.SqlQuery <int>(query, args).FirstOrDefault(); return(data); } }
public object SavePermission(PermissionsWithRoleID p) { String msg = " "; try { var permId = DataService.SavePermission(p, DateTime.UtcNow, SessionManager.CurrentUser.UserId); if (p.Id > 0) { msg = "Permission Updated Successfully"; } if (p.Id == 0) { msg = "Permission Added Successfully"; } return(new { data = new { PermssionId = permId }, success = true, error = msg }); } catch (Exception ex) { return(new { success = false, error = "Some Error has occurred" }); } }
public ResponseResult SavePermission(PermissionsWithRoleID p) { String msg = " "; try { var permId = DataService.SavePermission(p, DateTime.UtcNow, SessionManager.CurrentUser.UserId); if (p.Id > 0) { msg = "Permission Updated Successfully"; } if (p.Id == 0) { msg = "Permission Added Successfully"; } return(ResponseResult.GetSuccessObject(new { PermssionId = permId }, msg)); //return (new //{ // data = new // { // PermssionId = permId // }, // success = true, // error = msg //}); } catch (Exception ex) { CustomUtility.HandleException(ex); return(ResponseResult.GetErrorObject()); } }
public ResponseResult EnableDisablePermission(PermissionsWithRoleID r) { String msg = " "; try { bool rowdeleted = DataService.EnableDisablePermission(r.Id, r.IsActive, DateTime.UtcNow, SessionManager.CurrentUser.UserId); if (rowdeleted == true) { var param = (r.IsActive == false ? "disabled" : "enabled"); msg = String.Format("Permission is {0} successfully", param); } else { msg = " "; } return(ResponseResult.GetSuccessObject(new { PermssionId = r.Id }, msg)); //return (new //{ // success = true, // error = msg //}); } catch (Exception ex) { CustomUtility.HandleException(ex); return(ResponseResult.GetErrorObject()); } }
public Object SavePermission(PermissionsWithRoleID r) { return(Repository.SavePermission(r)); }
public Object EnableDisablePermission(PermissionsWithRoleID r) { return(Repository.EnableDisablePermission(r)); }
public ResponseResult EnableDisablePermission(PermissionsWithRoleID r) { return(Repository.EnableDisablePermission(r)); }
public ResponseResult SavePermission(PermissionsWithRoleID r) { return(Repository.SavePermission(r)); }