public int Insert(frmPos Pos) { return(base.ExecNonQuery("INSERT INTO " + "Position(PosName) " + "VALUES(@PosName)", GetParameter(Pos))); }
public object InsertScalar(frmPos Pos) { SqlParameter[] paramtemp = new SqlParameter[1]; paramtemp[0] = GetParameter(Pos)[2]; return(base.ExecScalar("INSERT INTO " + "Position(PosName) " + "OUTPUT INSERTED.PosID VALUES('@PosName')", paramtemp)); }
public SqlParameter[] GetParameter(frmPos Pos) { SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("PosID", Pos.PosID); param[1] = new SqlParameter("PosCode", Pos.PosCode); param[2] = new SqlParameter("PosName", Pos.PosName); return(param); }
private frmPos GetPos() { frmPos Pos = new frmPos(); Pos.PosID = int.Parse(txtPosID.Text); Pos.PosName = txtPosName.Text; Pos.PosCode = txtPosCode.Text; return(Pos); }
public int Update(frmPos Pos) { return(base.ExecNonQuery("UPDATE Position " + "SET PosName=@PosName WHERE PosID=@PosID", GetParameter(Pos))); }