public IHttpActionResult GetAdminUserDetailsForParent(JObject jsonResult) { var data = ""; var identity = MyAuthorizationServerProvider.AuthenticateUser(); if (identity != null) { string Message = string.Empty; UserBO objUser = new UserBO(); int ChildUserID = 0; if (identity.Role == ConstantMessages.Roles.superadmin) { objUser.UserID = identity.UserID; objUser.CompId = identity.CompId; objUser.Role = identity.Role; if (jsonResult.SelectToken("UserID") != null && jsonResult.SelectToken("UserID").ToString().Trim() != "") { ChildUserID = (int)jsonResult.SelectToken("UserID"); var ds = OrganizationBL.GetAdminUserDetails(objUser, ChildUserID); if (ds.Tables[0].Rows.Count > 0) { data = Utility.ConvertDataSetToJSONString(ds.Tables[0]); data = Utility.Successful(data); } else { data = Utility.API_Status("0", "No data found"); } } else { data = Utility.API_Status("2", "Please provide UserID"); } } else { data = Utility.API_Status("3", "You do not have access for this functionality"); } } else { data = Utility.AuthenticationError(); } return(new APIResult(Request, data)); }
public IHttpActionResult GetAdminUserDetails(JObject requestParams) { var data = ""; var identity = MyAuthorizationServerProvider.AuthenticateUser(); if (identity != null) { string Message = string.Empty; UserBO objUser = new UserBO(); int ChildUserID = 0; if (identity.Role == ConstantMessages.Roles.companyadmin) { objUser.UserID = identity.UserID; objUser.CompId = identity.CompId; objUser.Role = identity.Role; ChildUserID = Convert.ToInt32(identity.UserID); var ds = OrganizationBL.GetAdminUserDetails(objUser, ChildUserID); if (ds.Tables[0].Rows.Count > 0) { data = Utility.ConvertDataSetToJSONString(ds.Tables[0]); data = Utility.Successful(data); } else { data = Utility.API_Status("0", "No data found"); } } else { data = Utility.API_Status("3", "You do not have access for this functionality"); } } else { data = Utility.AuthenticationError(); } return(new APIResult(Request, data)); }