public void UpdateSYS_WidgetPage(SYS_WidgetPage sys_WidgetPage) { using (SqlConnection connection = GetConnection()) { SqlCommand command = new SqlCommand("_SYS_WidgetPageUpdate", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Type", 1); command.Parameters.AddWithValue("@ID", sys_WidgetPage.Id); command.Parameters.AddWithValue("@PageLayoutId", sys_WidgetPage.PageLayoutId); command.Parameters.AddWithValue("@RegionId", sys_WidgetPage.RegionId); command.Parameters.AddWithValue("@WidgetControl", sys_WidgetPage.WidgetControl); command.Parameters.AddWithValue("@WidgetDir", sys_WidgetPage.WidgetDir); command.Parameters.AddWithValue("@WidgetHTML", sys_WidgetPage.WidgetHTML); command.Parameters.AddWithValue("@WidgetIcon", sys_WidgetPage.WidgetIcon); command.Parameters.AddWithValue("@WidgetInfo", sys_WidgetPage.WidgetInfo); command.Parameters.AddWithValue("@WidgetName", sys_WidgetPage.WidgetName); command.Parameters.AddWithValue("@WidgetOrder", sys_WidgetPage.WidgetOrder); command.Parameters.AddWithValue("@WidgetRecord", sys_WidgetPage.WidgetRecord); command.Parameters.AddWithValue("@WidgetRecord2", sys_WidgetPage.WidgetRecord2); command.Parameters.AddWithValue("@WidgetStatus", sys_WidgetPage.WidgetStatus); command.Parameters.AddWithValue("@WidgetTitle", sys_WidgetPage.WidgetTitle); command.Parameters.AddWithValue("@WidgetValue", sys_WidgetPage.WidgetValue); command.Parameters.AddWithValue("@WidgetValue2", sys_WidgetPage.WidgetValue2); command.Parameters.AddWithValue("@Language", sys_WidgetPage.Language); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("khong cap nhat duoc sys_WidgetPage"); } else { command.Dispose(); } } }
private SYS_WidgetPage SYS_WidgetPageReader(SqlDataReader reader) { SYS_WidgetPage sys_WidgetPage = new SYS_WidgetPage(); sys_WidgetPage.Id = (int)reader["Id"]; sys_WidgetPage.PageLayoutId = (int)reader["PageLayoutId"]; sys_WidgetPage.RegionId = (string)reader["RegionId"]; sys_WidgetPage.WidgetControl = (string)reader["WidgetControl"]; sys_WidgetPage.WidgetDir = (string)reader["WidgetDir"]; sys_WidgetPage.WidgetHTML = (string)reader["WidgetHTML"]; sys_WidgetPage.WidgetIcon = (string)reader["WidgetIcon"]; sys_WidgetPage.WidgetInfo = (string)reader["WidgetInfo"]; sys_WidgetPage.WidgetName = (string)reader["WidgetName"]; sys_WidgetPage.WidgetOrder = (int)reader["WidgetOrder"]; sys_WidgetPage.WidgetRecord = (int)reader["WidgetRecord"]; sys_WidgetPage.WidgetRecord2 = (int)reader["WidgetRecord2"]; sys_WidgetPage.WidgetStatus = (bool)reader["WidgetStatus"]; sys_WidgetPage.WidgetTitle = (string)reader["WidgetTitle"]; sys_WidgetPage.WidgetValue = (string)reader["WidgetValue"]; sys_WidgetPage.WidgetValue2 = (string)reader["WidgetValue2"]; sys_WidgetPage.Language = (string)reader["Language"]; return(sys_WidgetPage); }
public SYS_WidgetPage GetSYS_WidgetPageById(int Id) { SYS_WidgetPage sys_WidgetPage = null; using (SqlConnection connection = GetConnection()) { SqlCommand command = new SqlCommand("_SYS_WidgetPageGetById", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Id", Id); connection.Open(); using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection)) { if (reader.Read()) { sys_WidgetPage = SYS_WidgetPageReader(reader); } else { throw new DataAccessException("Khong tim thay gia tri sys_WidgetPage"); } command.Dispose(); } } return(sys_WidgetPage); }
public int CreateSYS_WidgetPageGet(SYS_WidgetPage sys_WidgetPage) { int i = 0; using (SqlConnection connection = GetConnection()) { SqlCommand command = new SqlCommand("_SYS_WidgetPageInsert", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@Id", 0); command.Parameters.AddWithValue("@PageLayoutId", sys_WidgetPage.PageLayoutId); command.Parameters.AddWithValue("@RegionId", sys_WidgetPage.RegionId); command.Parameters.AddWithValue("@WidgetControl", sys_WidgetPage.WidgetControl); command.Parameters.AddWithValue("@WidgetDir", sys_WidgetPage.WidgetDir); command.Parameters.AddWithValue("@WidgetHTML", sys_WidgetPage.WidgetHTML); command.Parameters.AddWithValue("@WidgetIcon", sys_WidgetPage.WidgetIcon); command.Parameters.AddWithValue("@WidgetInfo", sys_WidgetPage.WidgetInfo); command.Parameters.AddWithValue("@WidgetName", sys_WidgetPage.WidgetName); command.Parameters.AddWithValue("@WidgetOrder", sys_WidgetPage.WidgetOrder); command.Parameters.AddWithValue("@WidgetRecord", sys_WidgetPage.WidgetRecord); command.Parameters.AddWithValue("@WidgetRecord2", sys_WidgetPage.WidgetRecord2); command.Parameters.AddWithValue("@WidgetStatus", sys_WidgetPage.WidgetStatus); command.Parameters.AddWithValue("@WidgetTitle", sys_WidgetPage.WidgetTitle); command.Parameters.AddWithValue("@WidgetValue", sys_WidgetPage.WidgetValue); command.Parameters.AddWithValue("@WidgetValue2", sys_WidgetPage.WidgetValue2); command.Parameters.AddWithValue("@Language", sys_WidgetPage.Language); SqlParameter parameter = new SqlParameter("@ReturnId", SqlDbType.Int); parameter.Direction = ParameterDirection.ReturnValue; command.Parameters.Add(parameter); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Khong them duoc"); } else { i = (int)parameter.Value; command.Dispose(); } } return(i); }
public void UpdateSYS_WidgetPage(SYS_WidgetPage sys_WidgetPage) { SYS_WidgetPageDAO sys_WidgetPageDAO = new SYS_WidgetPageDAO(); sys_WidgetPageDAO.UpdateSYS_WidgetPage(sys_WidgetPage); }
public int CreateSYS_WidgetPageGet(SYS_WidgetPage sys_WidgetPage) { SYS_WidgetPageDAO sys_WidgetPageDAO = new SYS_WidgetPageDAO(); return(sys_WidgetPageDAO.CreateSYS_WidgetPageGet(sys_WidgetPage)); }