/// <summary> /// Update a row /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Problem_Update(Problem entity) { return problem.Problem_Update(entity); }
/// <summary> /// Update a row /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Problem_Update(Problem entity) { using (SqlConnection conn = new SqlConnection(AppConfiguration.ConnectionString)) { SqlCommand command = new SqlCommand("Problem_Update", conn); command.CommandType = CommandType.StoredProcedure; try { command.Parameters.Add(new SqlParameter("@Problem_Id", SqlDbType.UniqueIdentifier)); command.Parameters["@Problem_Id"].Value = entity.Problem_Id; command.Parameters.Add(new SqlParameter("@Problem_Title", SqlDbType.NVarChar)); command.Parameters["@Problem_Title"].Value = entity.Problem_Title; command.Parameters.Add(new SqlParameter("@Problem_Content", SqlDbType.NVarChar)); command.Parameters["@Problem_Content"].Value = entity.Problem_Content; command.Parameters.Add(new SqlParameter("@Problem_IsDelete", SqlDbType.Bit)); command.Parameters["@Problem_IsDelete"].Value = entity.Problem_IsDelete; conn.Open(); return command.ExecuteNonQuery(); } catch (Exception ex) { throw ex; } finally { command.Dispose(); } } }
/// <summary> /// Addnew a row /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Problem_Insert(Problem entity) { return problem.Problem_Insert(entity); }