private void INIT() { DataTable dt = null; StringBuilder sb = new StringBuilder(); sb.Append("select idx, title from FIRMS order by title asc"); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { dt = db.GetDataTable(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { util.WriteLog(string.Format("{0} INIT ERR : {1}", this.GetType(), fex.Message)); return; } } _list = new List <Firm>( (from _row in dt.AsEnumerable() select new Firm() { idx = int.Parse(_row["idx"].ToString()) , title = _row["title"].ToString() } ).ToList <Firm>() ); }
public int Modify(Account _item) { int result = -1; DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@I_ID_MASTER", util.userid); dt.Rows.Add("@I_ID", _item.ID); dt.Rows.Add("@I_PWD", util.GetSHA1(_item.PWD)); dt.Rows.Add("@I_PWD_NEW", util.GetSHA1(_item.PWD_NEW)); dt.Rows.Add("@I_NAME", _item.NAME); dt.Rows.Add("@I_MEMO", _item.MEMO); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { db.BeginTran(); result = int.Parse(db.GetDataSP("UDT_USR", dt).ToString()); db.Commit(); Account __obj = _list.FirstOrDefault(x => x.ID == _item.ID); __obj.NAME = _item.NAME; __obj.MEMO = _item.MEMO; } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } return(result); }
public void Add(Account _item) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@I_ID", _item.ID); dt.Rows.Add("@I_PWD", util.GetSHA1(_item.PWD)); dt.Rows.Add("@I_NAME", _item.NAME); dt.Rows.Add("@I_MEMO", _item.MEMO); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { db.BeginTran(); db.ExcuteSP("INS_USR", dt); db.Commit(); _list.Add(_item); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } }
private void INIT() { DataTable dt = null; StringBuilder sb = new StringBuilder(); sb.Append("select innertel, title from EXCEPTIONS order by innertel asc"); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { dt = db.GetDataTable(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { util.WriteLog(string.Format("{0} INIT ERR : {1}", this.GetType(), fex.Message)); return; } } _list = new ObservableCollection <BILLException>( (from _row in dt.AsEnumerable() select new BILLException() { innertel = _row[0].ToString() , title = _row[1].ToString() } ).ToList <BILLException>() ); }
public void ADD(Firm item) { StringBuilder sb = new StringBuilder(); sb.Append("insert into FIRMS"); sb.Append("( title )"); sb.Append(" values "); sb.AppendFormat("( {0} )", item.title); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { int count = db.GetEffectedCount(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} ADD ERR : {1}", this.GetType(), fex.Message)); return; } } INIT(); }
public void add(Sms item) { DataTable dt; using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_CUST_TEL", FbDbType.VarChar, item.Cust_Tel); db.SetParameters("@I_MEMO", FbDbType.Text, item.Memo); db.SetParameters("@I_RESULT", FbDbType.SmallInt, item.Result); db.BeginTran(); dt = db.GetDataTableSP("INS_SMS_LIST"); db.Commit(); foreach (DataRow row in dt.Rows) { item.Idx = string.IsNullOrEmpty(row[0].ToString()) == false?int.Parse(row[0].ToString()) : -1; item.Cust_Idx = string.IsNullOrEmpty(row[1].ToString()) == false?int.Parse(row[1].ToString()) : -1; } this.Insert(0, item); } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); } } }
private void FileName2DB(string fn, string ext, string peernum) { try { using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn)) { db.SetParameters("@EXTENTION", FbDbType.VarChar, ext); db.SetParameters("@PEERNUMBER", FbDbType.VarChar, peernum); db.SetParameters("@FN", FbDbType.VarChar, fn); try { db.BeginTran(); db.ExcuteSP("INS_RECINFO"); db.Commit(); } catch (FbException e) { util.WriteLog(string.Format("SQL INS ERROR (INS_RECINF)\r\nMessage : {0}", e.Message)); db.Rollback(); } } } catch (FbException e) { util.WriteLog(string.Format("SQL INS ERROR (INS_RECINF)\r\nMessage : {0}", e.Message)); } }
public void ADD(INTERNATIONAL item) { StringBuilder sb = new StringBuilder(); sb.Append("insert into INTERNATIONAL"); sb.Append("( areacode, nation_num, nation_local_num, natione, nationk, lm )"); sb.Append(" values "); sb.AppendFormat("( {0}, '{1}', '{2}', '{3}', '{4}', '{5}' )", item.areacode, item.nation_num, item.nation_local_num, item.natione, item.nationk, item.lm); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { db.BeginTran(); int count = db.GetEffectedCount(); db.Commit(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} ADD ERR : {1}", this.GetType(), fex.Message)); return; } } INIT(); }
public Absences() { DataTable dt = null; using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn)) { try { dt = db.GetDataTableSP("GET_ABSENCECALL"); } catch (FirebirdSql.Data.FirebirdClient.FbException ex) { util.WriteLog(string.Format("DB Error ({0}) : {1}", this.GetType(), ex.Message)); } } foreach (DataRow row in dt.Rows) { Absence item = new Absence() { TELNUM = row[0].ToString(), DETAIL = row[1].ToString(), STATES = row[2].ToString() }; this.Add(item); } }
public AlarmAttentions() { using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn)) { DataTable dt = util.MakeDataTable2Proc(); DataRow dr = dt.NewRow(); dr["DataName"] = "@i_com_idx"; dr["DataValue"] = util.Userinfo.COM_IDX; dt.Rows.Add(dr); try { dt = db.GetDataTableSP("GET_ALARM_ATTENTION", dt); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { throw fe; } _obslist = new ObservableCollection <AlarmAttention>( (from myRow in dt.AsEnumerable() select new AlarmAttention() { Ch_Idx = myRow["o_ch_idx"].ToString() , Ch_Name = myRow["o_ch_name"].ToString() , Evt_Title = myRow["o_evt_title"].ToString() , Evt_Memo = myRow["o_evt_memo"].ToString() , Evt_Sdate = myRow["o_evt_sdate"].ToString() }).ToList <AlarmAttention>()); } }
public Smses(SearchCondition1 val) { DataTable dt; using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_SDATE", FbDbType.TimeStamp, val.StartDate); db.SetParameters("@I_EDATE", FbDbType.TimeStamp, val.EndDate); db.SetParameters("@I_NUMBER", FbDbType.VarChar, val.Number); dt = db.GetDataTableSP("GET_SMS_LIST"); foreach (DataRow row in dt.Rows) { this.Add(new Sms() { Idx = string.IsNullOrEmpty(row[0].ToString()) == false ? int.Parse(row[0].ToString()) : -1, Cust_Idx = string.IsNullOrEmpty(row[1].ToString()) == false ? int.Parse(row[1].ToString()) : -1, Cust_Name = row[2].ToString(), Cust_Tel = row[3].ToString(), Regdate = string.IsNullOrEmpty(row[4].ToString()) == false ? DateTime.Parse(row[4].ToString()) : new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local), Memo = row[5].ToString(), Result = string.IsNullOrEmpty(row[6].ToString()) == false ? int.Parse(row[6].ToString()) : -1 }); } } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); } } }
public ActLogs() { DataTable dt = null; StringBuilder sb = new StringBuilder(); sb.Append("select room, memo, regdate from tbl_log where datediff(day, cast(regdate as date), current_date)<=1 order by regdate desc"); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { dt = db.GetDataTable(); } catch (FirebirdSql.Data.FirebirdClient.FbException ex) { util.WriteLog(string.Format("DB Error ({0}) : {1}", this.GetType(), ex.Message)); } } foreach (DataRow row in dt.Rows) { this.Add(new ActLog() { TELNUM = row[0].ToString(), DETAIL = row[1].ToString() }); } }
public void modify(CallList item) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, item.Idx); db.SetParameters("@I_ENDDATE", FbDbType.TimeStamp, item.Enddate); db.BeginTran(); db.ExcuteSP("MODI_CALL_LIST"); db.Commit(); var itm = this.FirstOrDefault(x => x.Idx == item.Idx); //if (itm != null) //{ // int idx = this.IndexOf(itm); // this.RemoveAt(idx); // this.Insert(idx, item); //} } catch (FbException e) { // util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); throw e; } catch (Exception e) { util.WriteLog(e.Message); } } }
public AlarmBirths() { using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn)) { DataTable dt = util.MakeDataTable2Proc(); DataRow dr = dt.NewRow(); dr["DataName"] = "@i_com_idx"; dr["DataValue"] = util.Userinfo.COM_IDX; dt.Rows.Add(dr); try { dt = db.GetDataTableSP("GET_ALARM_BIRTH", dt); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { throw fe; } _obslist = new ObservableCollection <AlarmBirth>( (from myRow in dt.AsEnumerable() select new AlarmBirth() { Idx = myRow["o_idx"].ToString() , Name = myRow["o_name"].ToString() , Birth = myRow["o_birth"].ToString() , Birth_Luna = myRow["o_birth_luna"].ToString() , Cstg_Name = myRow["o_cstg_name"].ToString() , Remain_Birth = myRow["o_remain_birth"].ToString() }).ToList <AlarmBirth>()); } }
public void REMOVE(DOMESTICRATE item) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("delete from DOMESTIC_RATE where prefix={0}", item.prefix); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { db.BeginTran(); int count = db.GetEffectedCount(); db.Commit(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} REMOVE ERR : {1}", this.GetType(), fex.Message)); return; } } _list.Remove(item); //INIT(); }
public CBDutyLists() { DataTable dt = null; using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn)) { try { dt = db.GetDataTableSP("GET_DUTY_INFO"); } catch (System.Data.SqlClient.SqlException e) { throw e; } } CBDutyList gl = new CBDutyList() { Duty_Idx = "0" , Duty_Name = util.LoadProjectResource("TEXT_CB_FIRSTFIELD", "COMMONRES", "").ToString() }; this.Add(gl); foreach (DataRow myRow in dt.Rows) { gl = new CBDutyList() { Duty_Idx = myRow["o_duty_idx"].ToString() , Duty_Name = myRow["o_duty_name"].ToString() }; this.Add(gl); } }
public void ADD(DOMESTICRATE item) { StringBuilder sb = new StringBuilder(); sb.Append("insert into DOMESTIC_RATE"); sb.Append(" ( prefix, type, rate, sec )"); sb.Append(" values "); sb.AppendFormat("( '{0}', '{1}', {2}, {3} )", item.prefix, item.type, item.rate, item.sec); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { db.BeginTran(); int count = db.GetEffectedCount(); db.Commit(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} ADD ERR : {1}", this.GetType(), fex.Message)); return; } } //INIT(); _list.Add(item); }
public void MODIFY(DOMESTICRATE item) { StringBuilder sb = new StringBuilder(); sb.Append("update DOMESTIC_RATE set"); sb.AppendFormat(" type='{0}', rate={1}, sec={2} where prefix='{3}'", item.type, item.rate, item.sec, item.prefix); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { db.BeginTran(); int count = db.GetEffectedCount(); db.Commit(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} MODIFY ERR : {1}", this.GetType(), fex.Message)); return; } } //INIT(); }
private void INIT() { DataTable dt = null; StringBuilder sb = new StringBuilder(); sb.Append("select prefix, type, rate, sec from DOMESTIC_RATE order by prefix asc"); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { dt = db.GetDataTable(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { util.WriteLog(string.Format("{0} INIT ERR : {1}", this.GetType(), fex.Message)); return; } } _list = new ObservableCollection <DOMESTICRATE>( (from _row in dt.AsEnumerable() select new DOMESTICRATE() { prefix = _row["prefix"].ToString() , type = _row["type"].ToString() , rate = float.Parse(_row["rate"].ToString()) , sec = int.Parse(_row["sec"].ToString()) } ).ToList <DOMESTICRATE>() ); }
public void MODIFY(INTERNATIONALRATE item) { StringBuilder sb = new StringBuilder(); sb.Append("update INTERNATIONAL_RATE set"); sb.AppendFormat(" lrate={0}, lsec={1}, mrate={2}, msec={3} where areacode={4}", item.lrate, item.lsec, item.mrate, item.msec, item.areacode); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { int count = db.GetEffectedCount(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} MODIFY ERR : {1}", this.GetType(), fex.Message)); return; } } INTERNATIONALRATE _tmpobj = (INTERNATIONALRATE)_list.Where(x => x.areacode == item.areacode); _tmpobj.lrate = item.lrate; _tmpobj.lsec = item.lsec; _tmpobj.mrate = item.mrate; _tmpobj.msec = item.msec; //INIT(); }
public void ADD(INTERNATIONALRATE item) { StringBuilder sb = new StringBuilder(); sb.Append("insert into INTERNATIONAL_RATE"); sb.Append("( areacode, lrate, lsec, mrate, msec )"); sb.Append(" values "); sb.AppendFormat("( {0}, {1}, {2}, {3}, {4} )", item.areacode, item.lrate, item.lsec, item.mrate, item.msec); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { int count = db.GetEffectedCount(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} ADD ERR : {1}", this.GetType(), fex.Message)); return; } } _list.Add(item); //INIT(); }
public void MODIFY(INTERNATIONAL item) { StringBuilder sb = new StringBuilder(); sb.Append("update INTERNATIONAL set"); sb.AppendFormat(" areacode={0}, nation_num='{1}', nation_local_num='{2}', natione='{3}', nationk='{4}', lm='{5}' where idx={6}", item.areacode, item.nation_num, item.nation_local_num, item.natione, item.nationk, item.lm, item.idx); using (FirebirdDBHelper db = new FirebirdDBHelper(sb.ToString(), util.strDBConn)) { try { db.BeginTran(); int count = db.GetEffectedCount(); db.Commit(); } catch (FirebirdSql.Data.FirebirdClient.FbException fex) { db.Rollback(); util.WriteLog(string.Format("{0} MODIFY ERR : {1}", this.GetType(), fex.Message)); return; } } INIT(); }
public void remove(Customer item) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, item.Idx); db.BeginTran(); db.ExcuteSP("RMV_CUSTOMER"); db.Commit(); if (this.Items.Count > 0) { if (this.Items[0].Group_Idx == item.Group_Idx) { this.Remove(item); } } } catch (FbException e) { // util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); throw e; } } }
public void add(CallList item) { DataTable dt; using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_DIRECTION", FbDbType.Integer, item.Direction); db.SetParameters("@I_CUST_TEL", FbDbType.VarChar, item.Cust_Tel); db.SetParameters("@I_STARTDATE", FbDbType.TimeStamp, item.Startdate); db.BeginTran(); dt = db.GetDataTableSP("INS_CALL_LIST"); db.Commit(); foreach (DataRow row in dt.Rows) { item.Idx = string.IsNullOrEmpty(row[0].ToString()) == false?int.Parse(row[0].ToString()) : 0; item.Cust_Idx = string.IsNullOrEmpty(row[1].ToString()) == false?int.Parse(row[1].ToString()) : 0; } this.Insert(0, item); } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); } } }
public RoomRs(string floor) { DataTable dt = null; using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn)) { DataTable _input = util.CreateDT2SP(); _input.Rows.Add("@I_ROOM", floor); try { dt = db.GetDataTableSP("GET_ROOM_BY_FLOOR", _input); foreach (DataRow row in dt.Rows) { this.Add(new RoomR() { txtRoom = row[0].ToString() }); } } catch (FirebirdSql.Data.FirebirdClient.FbException ex) { util.WriteLog(string.Format("DB Error ({0}) : {1}", this.GetType(), ex.Message)); } } }
public Interviewes(int _id, string _sdate, string _edate, string _txt2, string _txt3) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@iseq", _id); dt.Rows.Add("@isdate", _sdate); dt.Rows.Add("@iedate", _edate); dt.Rows.Add("@itxt2", _txt2); dt.Rows.Add("@itxt3", _txt3); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { dt = db.GetDataTableSP("GET_INTERVIEWS", dt); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { //throw fe; } } _list = new ObservableCollection <Interview>( (from __row in dt.AsEnumerable() select new Interview() { seq = long.Parse(__row[0].ToString()) , fseq = int.Parse(string.IsNullOrEmpty(__row[1].ToString()) ? "0" : __row[1].ToString()) , forward = __row[2].ToString() , extention = __row[3].ToString() , peernum = __row[4].ToString() , recfile = __row[5].ToString() , regdate = DateTime.Parse(__row[6].ToString()) , regyymmdd = __row[7].ToString() , reghhmmss = __row[8].ToString() , fnlen = double.Parse(__row[9].ToString()) , tellername = __row[10].ToString() }).ToList <Interview>() ); }
public void update(GroupList item) { if (item.Idx == -1) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_NAME", FbDbType.VarChar, item.Name); db.BeginTran(); string idx = db.GetDataSP("INS_GROUPS").ToString(); db.Commit(); item.Idx = string.IsNullOrEmpty(idx) == false?int.Parse(idx) : -1; } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); } } } else { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, item.Idx); db.SetParameters("@I_NAME", FbDbType.VarChar, item.Name); db.BeginTran(); db.ExcuteSP("MODI_GROUPS"); db.Commit(); } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); throw e; } } } }
public Consultants(string _chk, string _sdate, string _edate, string _teller) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@I_CHK", _chk); dt.Rows.Add("@I_SDATE", _sdate); dt.Rows.Add("@I_EDATE", _edate); dt.Rows.Add("@I_TELLER", _teller); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { dt = db.GetDataTableSP("GET_LIST_BY_TELNUM", dt); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { //throw fe; } } _list = new ObservableCollection <Consultant>( (from _row in dt.AsEnumerable() select new Consultant() { telnum = _row["O_TELNUM"].ToString() , tellername = _row["O_TELLERNAME"].ToString() , calledsec = int.Parse(_row["O_CALLEDSEC"].ToString()) , callednum = int.Parse(_row["O_CALLEDNUM"].ToString()) , succeed = int.Parse(_row["O_SUCCEED"].ToString()) , absence = int.Parse(_row["O_ABSENCE"].ToString()) , failed = int.Parse(_row["O_FAILED"].ToString()) , avgcalledsec = int.Parse(_row["O_AVGCALLEDSEC"].ToString()) }).ToList <Consultant>() ); }
public InnerTels() { DataTable dt = null; try { using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { dt = db.GetDataTableSP("GET_INNERTELS"); } catch (FirebirdSql.Data.FirebirdClient.FbException fe1) { //throw fe; MessageBox.Show("test"); } } _list = new ObservableCollection<InnerTel>( (from __row in dt.AsEnumerable() select new InnerTel() { Seq = int.Parse(__row[0].ToString()) , Telnum = " " + __row[1].ToString() , TellerName = __row[2].ToString() } ).ToList<InnerTel>() ); //InnerTel _tmptel = new InnerTel() { Seq = 0, Telnum = "전체" }; //_list.Insert(0, _tmptel); } catch (FirebirdSql.Data.FirebirdClient.FbException fe0) { _list = new ObservableCollection<InnerTel>(); MessageBox.Show("Database 접속에 문제가 발생하였습니다.\r\n \"도구 → 환경설정 → 서버주소\"을 확인 후 다시 실행해 주세요."); } }
public FamilyRoles() { DataTable dt = null; using (FirebirdDBHelper db = new FirebirdDBHelper(util.strDBConn)) { try { dt = db.GetDataTableSP("GET_FAMILY_ROLE"); } catch (System.Data.SqlClient.SqlException e) { throw e; } } FamilyRole fr = new FamilyRole() { Fr_Idx = "0" , Fr_Name = util.LoadProjectResource("TEXT_CB_FIRSTFIELD", "COMMONRES", "").ToString() , Fr_Sort = "0" , Fr_Use = "1" }; _roles.Add(fr); foreach (DataRow myRow in dt.Rows) { fr = new FamilyRole() { Fr_Idx = myRow["o_fr_idx"].ToString() , Fr_Name = myRow["o_fr_name"].ToString() , Fr_Sort = myRow["o_fr_sort"].ToString() , Fr_Use = myRow["o_fr_use"].ToString() }; _roles.Add(fr); } }