public int Delete(int id) { string sql = "DELETE FROM PersonInfo WHERE Id = @Id"; var _params = new DynamicParameters(); _params.Add("@Id", id); int i = DbCon.Execute(sql, _params, commandType: CommandType.Text); return(i); }
public static bool Insert(UserProfiles bean) { StringBuilder sql = new StringBuilder(); sql.Append("INSERT INTO [USERPROFILES] "); sql.Append("([USER_FK], [PRO_FK])"); sql.Append("VALUES( @USER_FK, @PRO_FK)"); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Insert(Parameters bean) { StringBuilder sql = new StringBuilder(); sql.Append("INSERT INTO [PARAMETERS] "); sql.Append("([ID], [PARAMNAME], [PARAMTYPE], [NUMVAL], [DATEVAL], [BOOLVAL], [DESCRIPTION], [TEXTVAL], [EDITABLE]) "); sql.Append("VALUES( @ID, @PARAMNAME, @PARAMTYPE, @NUMVAL, @DATEVAL, @BOOLVAL, @DESCRIPTION, @TEXTVAL, @EDITABLE)"); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Insert(Functionalities bean) { StringBuilder sql = new StringBuilder(); sql.Append("INSERT INTO [FUNCTIONALITIES] "); sql.Append("([FUN_PK], [FUN_NAME]) "); sql.Append("VALUES( @FUN_PK, @FUN_NAME)"); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Update(Courses bean) { StringBuilder sql = new StringBuilder(); sql.Append("UPDATE [COURSES] "); sql.Append("SET [TITLE]=@TITLE, [PERIOD]=@PERIOD "); sql.Append("WHERE [COU_PK]=@COU_PK "); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Update(Profiles bean) { StringBuilder sql = new StringBuilder(); sql.Append("UPDATE [PROFILES] "); sql.Append("SET [PRO_NAME] = @PRO_NAME"); sql.Append("WHERE [PRO_PK] = @PRO_PK"); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Update(Users bean) { StringBuilder sql = new StringBuilder(); sql.Append("UPDATE [USERS] "); sql.Append("SET [FIRSTNAME]=@FIRSTNAME, [LASTNAME]=@LASTNAME, [USERNAME]=@USERNAME, [PWD]=@PWD "); sql.Append("WHERE [USR_PK]=@USR_PK "); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Insert(Users bean) { StringBuilder sql = new StringBuilder(); sql.Append("INSERT INTO [USERS] "); sql.Append("([USR_PK], [FIRSTNAME], [LASTNAME], [USERNAME], [PWD]) "); sql.Append("VALUES( @USR_PK, @FIRSTNAME, @LASTNAME, @USERNAME, @PWD)"); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Update(Parameters bean) { StringBuilder sql = new StringBuilder(); sql.Append("UPDATE [PARAMETERS] "); sql.Append("SET [PARAMNAME]=@PARAMNAME, [PARAMTYPE]=@PARAMTYPE, [NUMVAL]=@NUMVAL, [DATEVAL]=@DATEVAL, [BOOLVAL]=@BOOLVAL, [DESCRIPTION]=@DESCRIPTION, [TEXTVAL]=@TEXTVAL, [EDITABLE]=@EDITABLE "); sql.Append("WHERE [ID]=@ID "); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Update(Functionalities bean) { StringBuilder sql = new StringBuilder(); sql.Append("UPDATE [FUNCTIONALITIES] "); sql.Append("SET [FUN_NAME]=@FUN_NAME "); sql.Append("WHERE [FUN_PK]=@FUN_PK "); int rowsAffected = DbCon.Execute(sql.ToString(), bean); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Delete(int id) { StringBuilder sql = new StringBuilder(); sql.Append("DELETE FROM [FUNCTIONALITIES] "); sql.Append("WHERE [FUN_PK]=@FUN_PK "); int rowsAffected = DbCon.Execute(sql.ToString(), new { FUN_PK = id }); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Delete(int id) { StringBuilder sql = new StringBuilder(); sql.Append("DELETE FROM [PARAMETERS] "); sql.Append("WHERE [ID]=@ID "); int rowsAffected = DbCon.Execute(sql.ToString(), new { ID = id }); if (rowsAffected > 0) { return(true); } return(false); }
public static bool Delete(int usrID, int proID) { StringBuilder sql = new StringBuilder(); sql.Append("DELETE FROM [USERPROFILES] "); sql.Append("WHERE [USER_FK] = @USER_FK AND [PRO_FK]=@PRO_FK "); int rowsAffected = DbCon.Execute(sql.ToString(), new { USER_FK = usrID, PRO_FK = proID }); if (rowsAffected > 0) { return(true); } return(false); }
public int CreateOrUpdate(Person data) { var _params = new DynamicParameters(); _params.Add("@Id", data.Id); _params.Add("@Name", data.Name); _params.Add("@CountryId", data.CountryId); _params.Add("@CityId", data.CityId); _params.Add("@LanguageSkills", data.LanguageSkills); _params.Add("@DOB", data.DOB); if (data.Attachment != null) { _params.Add("@Attachment", data.Attachment == null? new byte[] { } : data.Attachment); } _params.Add("@FileName", data.FileName); _params.Add("@FileContentType", data.FileContentType); int i = DbCon.Execute("SP_CreateOrUpdatePerson", _params, commandType: CommandType.StoredProcedure); return(i); }
public int Update(T entity) { SqlProvider.FormatUpdate(a => entity); return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params)); }
public int Update(Expression <Func <T, T> > updateExpression) { SqlProvider.FormatUpdate(updateExpression); return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params, DbTransaction)); }
public int Delete() { SqlProvider.FormatDelete(); return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params, DbTransaction)); }
public int Insert(T entity) { SqlProvider.FormatInsert(entity); return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params, DbTransaction)); }