public SqlParameter[] GetParameter(frmT T) { SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("TID", T.TID); param[1] = new SqlParameter("TCode", T.TCode); param[2] = new SqlParameter("Description", T.Description); return(param); }
private frmT GetT() { frmT T = new frmT(); T.TID = Convert.ToInt32(txtTID.Text); T.TCode = txtTCode.Text; T.Description = txtDe.Text; return(T); }
public int Update(frmT T) { return(base.ExecNonQuery("UPDATE Type " + "SET Description=@Description WHERE TID=@TID", GetParameter(T))); }
public object InsertScalar(frmT T) { return(base.ExecScalar("INSERT INTO " + "Type(Description)OUTPUT INSERTED.TID VALUES(@Description)", GetParameter(T))); }
public int Insert(frmT T) { return(base.ExecNonQuery("INSERT INTO " + "Type(Description) VALUES(@Description)", GetParameter(T))); }