public void delete(EXTRA_FIELDS_SETTING_COMPONENT obj) { DAL.delete(obj.ExtraFieldID); }
public List <EXTRA_FIELDS_SETTING_COMPONENT> getDataSource() { List <EXTRA_FIELDS_SETTING_COMPONENT> list = new List <EXTRA_FIELDS_SETTING_COMPONENT>(); EXTRA_FIELDS_SETTING_COMPONENT obj = null; SqlConnection conn = MSSQLDBUtils.GetDBConnection(); conn.Open(); String sql = "USE [rbi]" + "SELECT [ExtraFieldID]" + ",[FieldID]" + ",[FieldName]" + ",[FieldDescription]" + ",[SeqNo]" + ",[FieldType]" + ",[FieldSize]" + ",[IsActive]" + ",[IsCreated]" + " FROM [rbi].[dbo].[EXTRA_FIELDS_SETTING_COMPONENT]"; try { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = sql; using (DbDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { if (reader.HasRows) { obj = new EXTRA_FIELDS_SETTING_COMPONENT(); obj.ExtraFieldID = reader.GetInt32(0); if (!reader.IsDBNull(1)) { obj.FieldID = reader.GetString(1); } if (!reader.IsDBNull(2)) { obj.FieldName = reader.GetString(2); } if (!reader.IsDBNull(3)) { obj.FieldDescription = reader.GetString(3); } if (!reader.IsDBNull(4)) { obj.SeqNo = reader.GetInt32(4); } if (!reader.IsDBNull(5)) { obj.FieldType = reader.GetString(5); } if (!reader.IsDBNull(6)) { obj.FieldSize = reader.GetInt32(6); } obj.IsActive = reader.GetInt32(7); obj.IsCreated = reader.GetInt32(8); list.Add(obj); } } } } catch { MessageBox.Show("GET DATA SOURCE FAIL!"); } finally { conn.Close(); } return(list); }
public void edit(EXTRA_FIELDS_SETTING_COMPONENT obj) { DAL.edit(obj.ExtraFieldID, obj.FieldID, obj.FieldName, obj.FieldDescription, obj.SeqNo, obj.FieldType, obj.FieldSize, obj.IsActive, obj.IsCreated); }