Beispiel #1
0
        public static int UpdateRecord(int iId, string sName, string sBiography, DateTime dAddedOn, bool bStatus)
        {
            DataLibrary.Models.PeopleModel data = new DataLibrary.Models.PeopleModel
            {
                name      = sName,
                biography = sBiography,
                status    = bStatus
            };

            string sqlU = @"update dbo.People set [name]=@name, [biography]=@biography, [status]=@status  
                            where Id=" + iId + ";";

            return(SqlDataAccess.SaveData(sqlU, data));
        }
Beispiel #2
0
        public static int CreateRecord(int iId, string sName, string sBiography, DateTime dAddedOn, bool bStatus)
        {
            DataLibrary.Models.PeopleModel data = new DataLibrary.Models.PeopleModel
            {
                id        = iId,
                name      = sName,
                biography = sBiography,
                addedOn   = dAddedOn,
                status    = bStatus
            };

            string sql = @"insert into dbo.People ([name], [biography], [status]) 
                            values (@name,  @biography, @status);";

            return(SqlDataAccess.SaveData(sql, data));
        }