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(); } } }
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 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; } } }
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 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 void remove(Sms item) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, item.Idx); db.BeginTran(); db.ExcuteSP("RMV_SMS_LIST"); db.Commit(); this.Remove(item); } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); } } }
public void savememo() { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, this.Idx); db.SetParameters("@I_MEMO", FbDbType.VarChar, util.encStr(this.Memo)); db.BeginTran(); db.ExcuteSP("MODI_CALL_LIST_MEMO"); db.Commit(); } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); throw e; } } }
public static void Log2DB(string ext, string msg, string chk) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@I_ROOM", ext); dt.Rows.Add("@I_MEMO", msg); dt.Rows.Add("@I_CHK", chk); using (FirebirdDBHelper db = new FirebirdDBHelper(strDBConn)) { try { db.BeginTran(); db.ExcuteSP("INS_LOG", dt); db.Commit(); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } }
public void Remove(InnerTel _itel) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@seq", _itel.Seq); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { db.BeginTran(); db.ExcuteSP("RMV_INNERTELS", dt); db.Commit(); InnerTel __obj = _list.FirstOrDefault(x => x.Seq == _itel.Seq); _list.Remove(__obj); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } }
public void Add(InnerTel _itel) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@telnum", _itel.Telnum); dt.Rows.Add("@tellername", _itel.TellerName); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { db.BeginTran(); db.ExcuteSP("INS_INNERTELS", dt); db.Commit(); _list.Add(_itel); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } }
public void modify(Customer item) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, item.Idx); db.SetParameters("@I_GROUP_IDX", FbDbType.Integer, item.Group_Idx); db.SetParameters("@I_NAME", FbDbType.VarChar, item.Name); db.SetParameters("@I_COMPANY", FbDbType.VarChar, item.Company); db.SetParameters("@I_TITLE", FbDbType.VarChar, item.Title); db.SetParameters("@I_TEL", FbDbType.VarChar, item.Tel); db.SetParameters("@I_CELLULAR", FbDbType.VarChar, item.Cellular); db.SetParameters("@I_EXTENSION", FbDbType.VarChar, item.Extension); db.SetParameters("@I_EMAIL", FbDbType.VarChar, item.Email); db.SetParameters("@I_ADDR", FbDbType.VarChar, item.Addr); db.BeginTran(); db.ExcuteSP("MODI_CUSTOMER"); db.Commit(); if (this.Items.Count > 0) { if (this.Items[0].Group_Idx == item.Group_Idx) { var itm = this.FirstOrDefault(x => x.Idx == item.Idx); int idx = this.IndexOf(itm); this.RemoveAt(idx); this.Insert(idx, item); } } } catch (FbException e) { util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); } } }
public void Remove(Account _item) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@I_ID", _item.ID); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { db.BeginTran(); db.ExcuteSP("RMV_USR", dt); db.Commit(); Account __obj = _list.FirstOrDefault(x => x.ID == _item.ID); _list.Remove(__obj); } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } }
public void Modify(InnerTel _itel) { DataTable dt = util.CreateDT2SP(); dt.Rows.Add("@seq", _itel.Seq); dt.Rows.Add("@telnum", _itel.Telnum); dt.Rows.Add("@tellername", _itel.TellerName); using (FirebirdDBHelper db = new FirebirdDBHelper(util.strFBDBConn2)) { try { db.BeginTran(); db.ExcuteSP("UDT_INNERTELS", dt); db.Commit(); InnerTel __obj = _list.FirstOrDefault(x => x.Telnum == _itel.Telnum); __obj.TellerName = _itel.TellerName; } catch (FirebirdSql.Data.FirebirdClient.FbException fe) { db.Rollback(); } } }
public void remove(GroupList item) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, item.Idx); db.BeginTran(); db.ExcuteSP("RMV_GROUPS"); db.Commit(); var itm = this.Items[0].Children.FirstOrDefault(x => x.Idx == item.Idx); this.Items[0].Children.Remove(itm); } catch (FbException e) { // util.WriteLog(e.ErrorCode, e.Message); db.Rollback(); throw e; } } }