Exemplo n.º 1
0
        public List <clsregprp> fnd_rec(Int32 regcod)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("fndreg", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@regcod", SqlDbType.Int).Value = regcod;
            SqlDataReader    dr  = cmd.ExecuteReader();
            List <clsregprp> obj = new List <clsregprp>();

            if (dr.HasRows)
            {
                dr.Read();
                clsregprp x = new clsregprp();
                x.regcod = Convert.ToInt32(dr[0]);
                x.regeml = dr[1].ToString();
                x.regpwd = dr[2].ToString();
                x.regdat = Convert.ToDateTime(dr[3]);
                x.regsts = Convert.ToChar(dr[4]);
                obj.Add(x);
            }
            dr.Close();
            cmd.Dispose();
            con.Close();
            return(obj);
        }
Exemplo n.º 2
0
        public List <clsregprp> dsp_rec()
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("dspreg", con);

            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataReader    dr  = cmd.ExecuteReader();
            List <clsregprp> obj = new List <clsregprp>();

            while (dr.Read())
            {
                clsregprp x = new clsregprp();
                x.regcod = Convert.ToInt32(dr[0]);
                x.regeml = dr[1].ToString();
                x.regpwd = dr[2].ToString();
                x.regdat = Convert.ToDateTime(dr[3]);
                x.regsts = Convert.ToChar(dr[4]);
                obj.Add(x);
            }
            dr.Close();
            cmd.Dispose();
            con.Close();
            return(obj);
        }
Exemplo n.º 3
0
        public void del_rec(clsregprp p)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("delreg", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@regcod", SqlDbType.Int).Value = p.regcod;
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }
Exemplo n.º 4
0
        public void save_rec(clsregprp p)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("insreg", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@regeml", SqlDbType.VarChar, 50).Value = p.regeml;
            cmd.Parameters.Add("@regpwd", SqlDbType.VarChar, 50).Value = p.regpwd;
            cmd.Parameters.Add("@regdat", SqlDbType.DateTime).Value    = p.regdat;
            cmd.Parameters.Add("@regsts", SqlDbType.Char, 1).Value     = p.regsts;
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }
Exemplo n.º 5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     nsskills.clsreg    obj    = new nsskills.clsreg();
     nsskills.clsregprp objprp = new nsskills.clsregprp();
     objprp.regeml = txteml.Text;
     objprp.regpwd = txtpwd.Text;
     objprp.regdat = DateTime.Now;
     objprp.regsts = 'U';
     try
     {
         obj.save_rec(objprp);
         Label1.Text = "Registration Successful";
     }
     catch (Exception exp)
     {
         Label1.Text = "Registration Not Successful";
     }
 }