Example #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);
 }
Example #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);
        }
Example #3
0
 public int Update(frmPT PT)
 {
     return(base.ExecNonQuery("UPDATE Phone_Type " +
                              "SET Description=@Description WHERE PTypeID=@PTID", GetParameter(PT)));
 }
Example #4
0
 public object InsertScalar(frmPT PT)
 {
     return(base.ExecScalar("INSERT INTO " +
                            "Phone_Type(Description)OUTPUT INSERTED.PTypeID VALUES(@Description)", GetParameter(PT)));
 }
Example #5
0
 public int Insert(frmPT PT)
 {
     return(base.ExecNonQuery("INSERT INTO " +
                              "Phone_Type(Description) VALUES(@Description)", GetParameter(PT)));
 }