public void DataBindingCmbSpxh(ComboBox cmbspxh, rkb r) { //组合框的绑定 db.AddParameters("@spbh", SqlDbType.Int, r.spbh); dtspm = db.Select("select spbh,xh from spxxb where spbh=@spbh"); bd.bd(cmbspxh, dtspm, "xh", "xh"); }
public void Insertrkhj(rkb r) { DataTable dthj = new DataTable(); db.AddParameters("@hjbh", SqlDbType.Char, r.cfhj); db.AddParameters("@spbh", SqlDbType.Int, r.spbh); db.AddParameters("@xh", SqlDbType.VarChar, r.xh); db.AddParameters("@sl", SqlDbType.Int, r.sl); dthj = db.Select("select * from hjxxb where hjbh=@hjbh and spbh=@spbh and xh=@xh"); if (dthj.Rows.Count == 1) { db.AddParameters("@hjbh", SqlDbType.Char, r.cfhj); db.AddParameters("@spbh", SqlDbType.Int, r.spbh); db.AddParameters("@xh", SqlDbType.VarChar, r.xh); db.AddParameters("@sl", SqlDbType.Int, r.sl); db.Update("update hjxxb set sl=sl+@sl where hjbh=@hjbh and spbh=@spbh and xh=@xh"); } else { db.AddParameters("@hjbh", SqlDbType.Char, r.cfhj); db.AddParameters("@spbh", SqlDbType.Int, r.spbh); db.AddParameters("@xh", SqlDbType.VarChar, r.xh); db.AddParameters("@sl", SqlDbType.Int, r.sl); db.Insert("insert into hjxxb (hjbh,spbh,xh,sl) values (@hjbh,@spbh,@xh,@sl)"); } }
public void Updaterktj(rkb r) { db.AddParameters("@spbh", SqlDbType.Int, r.spbh); db.AddParameters("@xh", SqlDbType.VarChar, r.xh); db.AddParameters("@sl", SqlDbType.Int, r.sl); db.Update("update spxxb set sl=sl+@sl where spbh=@spbh and xh=@xh"); }
public void DataBindingDataGridView(DataGridView dgvrk, int num, rkb r, gysb g) { dgvrk.Rows.Add(); dgvrk.Rows[num].Cells[0].Value = r.spm; dgvrk.Rows[num].Cells[1].Value = r.xh; dgvrk.Rows[num].Cells[2].Value = r.sl; dgvrk.Rows[num].Cells[3].Value = g.gys; dgvrk.Rows[num].Cells[4].Value = r.cfhj; }
public void dgvCellContentClickth(rkb r) { db.AddParameters("@spm", SqlDbType.NChar, r.spm); db.AddParameters("@xh", SqlDbType.Char, r.xh); db.AddParameters("@sl", SqlDbType.Char, r.sl); db.AddParameters("@rkr", SqlDbType.Char, r.rkr); db.AddParameters("@gys", SqlDbType.Char, r.gys); db.AddParameters("@hjbh", SqlDbType.Char, r.cfhj); db.Update("update rkb set yz=-1 where spm=@spm and xh=@xh and sl=@sl and rkr=@rkr and hjbh=@hjbh and yz=1"); }
public void Insertrktj(rkb r) { db.AddParameters("@spbh", SqlDbType.Int, r.spbh); db.AddParameters("@spm", SqlDbType.Char, r.spm); db.AddParameters("@xh", SqlDbType.VarChar, r.xh); db.AddParameters("@sl", SqlDbType.Int, r.sl); db.AddParameters("@rkr", SqlDbType.VarChar, r.rkr); db.AddParameters("@gysbh", SqlDbType.Int, r.gysbh); db.AddParameters("@hjbh", SqlDbType.Char, r.cfhj); db.Insert("insert into rkb (spbh,spm,xh,sl,rkr,gysbh,hjbh,rksj,yz)values(@spbh,@spm,@xh,@sl,@rkr,@gysbh,@hjbh,GETDATE(),1)"); }