/// <summary> /// Execute SP_Log_Insert /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_Log_Insert.Inputs data) { string sql = "dbo.SP_Log_Insert"; var p = Common.GetEmptyParams(); p.Add("@MSG", data.MSG); p.Add("@IPAddress", data.IPAddress); var dbResult = _executer.Query <Models.Database.StoredProcedures.SP_Log_Insert.Outputs>( sql, data, commandType: System.Data.CommandType.StoredProcedure); var rst = new DBResult(200, "", dbResult); return(rst); }
/// <summary> /// Execute SP_User_SetPassword /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_User_SetPassword.Inputs data) { string sql = "dbo.SP_User_SetPassword"; var p = Common.GetDataParams(data); p.Add("@UserId", data.UserId); p.Add("@Password", data.Password); var dbResult = _executer.Query<Models.Database.StoredProcedures.SP_User_SetPassword.Outputs>( sql, p, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault(); var rst = Common.GetResult(p, dbResult); return rst; }
/// <summary> /// Execute SP_Login /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_Login.Inputs data) { string sql = "dbo.SP_Login"; var p = Common.GetErrorCodeAndErrorMessageParams(); p.Add("@Email", data.Email); p.Add("@Password", data.Password); var dbResult = _executer.Query <Models.Database.StoredProcedures.SP_Login.Outputs>( sql, p, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault(); var rst = Common.GetResult(p, dbResult); return(rst); }
/// <summary> /// Execute SP_User_AccessToAPI /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_User_AccessToAPI.Inputs data) { string sql = "dbo.SP_User_AccessToAPI"; var p = Common.GetErrorCodeAndErrorMessageParams(); p.Add("@Token", data.Token); p.Add("@APIAddress", data.APIAddress); var dbResult = _executer.Query <Models.Database.StoredProcedures.SP_User_AccessToAPI.Outputs>( sql, p, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault(); var rst = Common.GetResult(p, dbResult); return(rst); }
/// <summary> /// Execute SP_User_UpdateProfile /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_User_UpdateProfile.Inputs data) { string sql = "dbo.SP_User_UpdateProfile"; var p = Common.GetDataParams(data); p.Add("@FirstName", data.FirstName); p.Add("@LastName", data.LastName); var dbResult = _executer.Query <Models.Database.StoredProcedures.SP_User_UpdateProfile.Outputs>( sql, p, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault(); var rst = Common.GetResult(p, dbResult); return(rst); }
/// <summary> /// Execute SP_Users_GetAll /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_Users_GetAll.Inputs data) { string sql = "dbo.SP_Users_GetAll"; var p = Common.GetSearchParams(data); p.Add("@Email", data.Email); p.Add("@FirstName", data.FirstName); p.Add("@LastName", data.LastName); var dbResult = _executer.Query <Models.Database.StoredProcedures.SP_Users_GetAll.Outputs>( sql, p, commandType: System.Data.CommandType.StoredProcedure); var rst = Common.GetResult(p, dbResult); return(rst); }
/// <summary> /// Execute SP_APILog_Insert /// </summary> /// <param name="data"></param> /// <returns></returns> private DBResult Execute(Models.Database.StoredProcedures.SP_APILog_Insert.Inputs data) { string sql = "dbo.SP_APILog_Insert"; var p = Common.GetEmptyParams(); p.Add("@APIAddress", data.APIAddress); p.Add("@UserToken", data.UserToken); p.Add("@Params", data.Params); p.Add("@Results", data.Results); p.Add("@ErrorMessage", data.ErrorMessage); p.Add("@StatusCode", data.StatusCode); var dbResult = _executer.Query <Models.Database.StoredProcedures.SP_APILog_Insert.Outputs>( sql, data, commandType: System.Data.CommandType.StoredProcedure).FirstOrDefault(); var rst = new DBResult(200, "", dbResult); return(rst); }