Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        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);
        }
Пример #14
0
        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));
        }
Пример #16
0
        public int Update(Expression <Func <T, T> > updateExpression)
        {
            SqlProvider.FormatUpdate(updateExpression);

            return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params, DbTransaction));
        }
Пример #17
0
        public int Delete()
        {
            SqlProvider.FormatDelete();

            return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params, DbTransaction));
        }
Пример #18
0
        public int Insert(T entity)
        {
            SqlProvider.FormatInsert(entity);

            return(DbCon.Execute(SqlProvider.SqlString, SqlProvider.Params, DbTransaction));
        }