public CallLists GetCallListByCustIdx(int cust_idx, string cust_tel) { DataTable dt; CallLists lists = new CallLists(); using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.Integer, cust_idx); db.SetParameters("@I_CUST_TEL", FbDbType.VarChar, cust_tel); dt = db.GetDataTableSP("GET_CALL_LIST2"); foreach (DataRow row in dt.Rows) { lists.Add(new CallList() { IsChecked = false, IsSelected = false, 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, Name = row[2].ToString(), Direction = string.IsNullOrEmpty(row[3].ToString()) == false ? int.Parse(row[3].ToString()) : -1, Cust_Tel = row[4].ToString(), Startdate = string.IsNullOrEmpty(row[5].ToString()) == false ? DateTime.Parse(row[5].ToString()) : new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local), Enddate = string.IsNullOrEmpty(row[6].ToString()) == false ? DateTime.Parse(row[6].ToString()) : new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local), Memo = util.decStr(row[7].ToString()) }); } } catch (FbException ex) { util.WriteLog(ex.ErrorCode, ex.Message); } } return lists; }
private void FileName2DB(double idx, string fn, double fnlen, string ext, string peernum) { using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { db.SetParameters("@EXTENTION", FbDbType.VarChar, ext); db.SetParameters("@PEERNUMBER", FbDbType.VarChar, peernum); db.SetParameters("@FN", FbDbType.VarChar, fn); db.SetParameters("@FNLEN", FbDbType.Double, fnlen); try { db.BeginTran(); db.ExcuteSP("INS_RECINFO3"); db.Commit(); } catch (FbException e) { util.WriteLog(string.Format("SQL INS ERROR (INS_RECINFO3)\r\nMessage : {0}", e.Message)); db.Rollback(); } } }
public Customer GetCustomerByTel(string tel) { DataTable dt; Customer cust = null; using (FirebirdDBHelper db = new FirebirdDBHelper(util.GetFbDbStrConn())) { try { db.SetParameters("@I_IDX", FbDbType.VarChar, tel); dt = db.GetDataTableSP("GET_CUSTOMER_BY_TEL"); foreach (DataRow row in dt.Rows) { cust = new Customer() { IsChecked = false, IsSelected = false, Idx = string.IsNullOrEmpty(row[0].ToString()) == false ? int.Parse(row[0].ToString()) : -1, Group_Idx = string.IsNullOrEmpty(row[1].ToString()) == false ? int.Parse(row[1].ToString()) : 0, Name = row[2].ToString(), Company = row[3].ToString(), Title = row[4].ToString(), Tel = row[5].ToString(), Cellular = row[6].ToString(), Extension = row[7].ToString(), Email = row[8].ToString(), Addr = row[9].ToString(), Etc = row[10].ToString() }; } } catch (FbException ex) { util.WriteLog(ex.ErrorCode, ex.Message); } } return cust; }