Exemple #1
0
 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);
 }
Exemple #2
0
        private frmPT GetPT()
        {
            frmPT PT = new frmPT();

            PT.PTypeID     = Convert.ToInt32(txtPTID.Text);
            PT.PTypeCode   = txtPTCode.Text;
            PT.Description = txtDe.Text;
            return(PT);
        }
Exemple #3
0
 public int Update(frmPT PT)
 {
     return(base.ExecNonQuery("UPDATE Phone_Type " +
                              "SET Description=@Description WHERE PTypeID=@PTID", GetParameter(PT)));
 }
Exemple #4
0
 public object InsertScalar(frmPT PT)
 {
     return(base.ExecScalar("INSERT INTO " +
                            "Phone_Type(Description)OUTPUT INSERTED.PTypeID VALUES(@Description)", GetParameter(PT)));
 }
Exemple #5
0
 public int Insert(frmPT PT)
 {
     return(base.ExecNonQuery("INSERT INTO " +
                              "Phone_Type(Description) VALUES(@Description)", GetParameter(PT)));
 }