public SqlParameter[] GetParameter(frmPT PT) { SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("PTID", PT.PTypeID); param[1] = new SqlParameter("PTypeCode", PT.PTypeCode); param[2] = new SqlParameter("Description", PT.Description); return(param); }
private frmPT GetPT() { frmPT PT = new frmPT(); PT.PTypeID = Convert.ToInt32(txtPTID.Text); PT.PTypeCode = txtPTCode.Text; PT.Description = txtDe.Text; return(PT); }
public int Update(frmPT PT) { return(base.ExecNonQuery("UPDATE Phone_Type " + "SET Description=@Description WHERE PTypeID=@PTID", GetParameter(PT))); }
public object InsertScalar(frmPT PT) { return(base.ExecScalar("INSERT INTO " + "Phone_Type(Description)OUTPUT INSERTED.PTypeID VALUES(@Description)", GetParameter(PT))); }
public int Insert(frmPT PT) { return(base.ExecNonQuery("INSERT INTO " + "Phone_Type(Description) VALUES(@Description)", GetParameter(PT))); }