private void dgvSip2ServerMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (IdIsNull()) { MessageBox.Show("请选择具体的行!", "警告"); return; } Sip2Model model = new Sip2Model() { IP = dgvSip2Server.CurrentRow.Cells["ip"].Value.ToString(), Port = dgvSip2Server.CurrentRow.Cells["port"].Value.ToString(), AO = dgvSip2Server.CurrentRow.Cells["ao"].Value.ToString(), AP = dgvSip2Server.CurrentRow.Cells["ap"].Value.ToString(), Charset = dgvSip2Server.CurrentRow.Cells["字符集"].Value.ToString(), Uid = dgvSip2Server.CurrentRow.Cells["uid"].Value.ToString(), Pwd = dgvSip2Server.CurrentRow.Cells["pwd"].Value.ToString(), VP = dgvSip2Server.CurrentRow.Cells["vp"].Value.ToString(), LocationCode = dgvSip2Server.CurrentRow.Cells["locationcode"].Value.ToString(), ReaderCode = dgvSip2Server.CurrentRow.Cells["readercode"].Value.ToString(), PIN = dgvSip2Server.CurrentRow.Cells["pin"].Value.ToString(), BookCode = dgvSip2Server.CurrentRow.Cells["bookcode"].Value.ToString(), }; mform.SyncSip2Info(model); this.Close(); }
public void SyncSip2Info(Sip2Model model) { txtIP.Text = model.IP; txtPort.Text = model.Port; txtAO.Text = model.AO; txtAP.Text = model.AP; txtCharset.Text = model.Charset; txtUserName.Text = model.Uid; txtPwd.Text = model.Pwd; cboxVP.Text = model.VP; txtLocationCode.Text = model.LocationCode; txtReaderCode.Text = model.ReaderCode; txtPIN.Text = model.PIN; txtBookCode.Text = model.BookCode; }
public Sip2Helper(Sip2Model sip2Info) { host = sip2Info.IP; port = int.Parse(sip2Info.Port); AO = sip2Info.AO; AP = sip2Info.AP; VP = sip2Info.VP; locationCode = sip2Info.LocationCode; charset = sip2Info.Charset; username = sip2Info.Uid; password = sip2Info.Pwd; if (host != string.Empty && port != 0) { sipclient = new sip2(host, port, AO, AP, VP); sipclient.setCharset(charset); ConnentServer(); } }
private void btnUpdate_Click(object sender, EventArgs e) { int id = 0; if (IdIsNull(ref id)) { MessageBox.Show("请选择具体的行!", "警告"); return; } //获取基目录,它由程序集冲突解决程序用来探测程序集。 string dbPath = AppDomain.CurrentDomain.BaseDirectory + "Sip2Info.db"; SQLiteDBHelper db = new SQLiteDBHelper(dbPath); string sql = @"select id, name, ip, port, ao, ap, charset, uid, pwd, vp, locationcode, readercode, pin, bookcode from Sip2Info where id = " + id; DataTable dt = db.ExecuteDataTable(sql, null); SetSip2Form form = new Sip2Service.SetSip2Form(this); Sip2Model model = new Sip2Model() { id = int.Parse(dt.Rows[0]["id"].ToString()), Sip2Name = dt.Rows[0]["name"].ToString(), IP = dt.Rows[0]["ip"].ToString(), Port = dt.Rows[0]["port"].ToString(), AO = dt.Rows[0]["ao"].ToString(), AP = dt.Rows[0]["ap"].ToString(), Charset = dt.Rows[0]["charset"].ToString(), Uid = dt.Rows[0]["uid"].ToString(), Pwd = dt.Rows[0]["pwd"].ToString(), VP = dt.Rows[0]["vp"].ToString(), LocationCode = dt.Rows[0]["locationcode"].ToString(), ReaderCode = dt.Rows[0]["readercode"].ToString(), PIN = dt.Rows[0]["pin"].ToString(), BookCode = dt.Rows[0]["bookcode"].ToString() }; form.SyncSpi2Info(model); form.ShowDialog(); }