Esempio n. 1
0
        public List <clsdetfrmprp> find_rec_detfrm(Int32 frmcod)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("finddetfrm", con);

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

            if (dr.HasRows)
            {
                dr.Read();
                clsdetfrmprp k = new clsdetfrmprp();
                k.frmcod     = Convert.ToInt32(dr[0]);
                k.frmregcod  = Convert.ToInt32(dr[1]);
                k.frmtit     = dr[2].ToString();
                k.frmdate    = Convert.ToDateTime(dr[3]);
                k.frmurl     = dr[4].ToString();
                k.frmdesc    = dr[5].ToString();
                k.frmreqcont = dr[6].ToString();

                obj.Add(k);
            }
            dr.Close();
            cmd.Dispose();
            con.Close();
            return(obj);
        }
Esempio n. 2
0
        public List <clsdetfrmprp> disp_rec_detfrm()
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("dispdetfrm", con);

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

            while (dr.Read())
            {
                clsdetfrmprp k = new clsdetfrmprp();
                k.frmcod     = Convert.ToInt32(dr[0]);
                k.frmtit     = dr[2].ToString();
                k.frmdate    = Convert.ToDateTime(dr[3]);
                k.frmurl     = dr[4].ToString();
                k.frmdesc    = dr[5].ToString();
                k.frmreqcont = dr[6].ToString();

                obj.Add(k);
            }
            dr.Close();
            cmd.Dispose();
            con.Close();
            return(obj);
        }
Esempio n. 3
0
        public void save_rec_detfrm(clsdetfrmprp p)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("insdetfrm", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@frmregcod", SqlDbType.Int).Value          = p.frmregcod;
            cmd.Parameters.Add("@frmtit", SqlDbType.VarChar, 50).Value     = p.frmtit;
            cmd.Parameters.Add("@frmdate", SqlDbType.DateTime).Value       = p.frmdate;
            cmd.Parameters.Add("@frmurl", SqlDbType.VarChar, 100).Value    = p.frmurl;
            cmd.Parameters.Add("@frmdesc", SqlDbType.VarChar, 100).Value   = p.frmdesc;
            cmd.Parameters.Add("@frmreqcont", SqlDbType.VarChar, 50).Value = p.frmreqcont;

            cmd.Parameters.Add("@frmimg", SqlDbType.VarChar, 200).Value      = DBNull.Value;
            cmd.Parameters.Add("@frmvideo", SqlDbType.VarChar, 200).Value    = DBNull.Value;
            cmd.Parameters.Add("@frmstatus", SqlDbType.VarChar, 200).Value   = "New";
            cmd.Parameters.Add("@frmsubmitdate", SqlDbType.DateTime).Value   = p.frmsubmitdate;
            cmd.Parameters.Add("@frmpayment", SqlDbType.VarChar, 1000).Value = p.frmpayment;
            cmd.Parameters.Add("@pdt", SqlDbType.DateTime).Value             = DBNull.Value;
            cmd.Parameters.Add("@rdt", SqlDbType.DateTime).Value             = DBNull.Value;
            cmd.Parameters.Add("@r", SqlDbType.Int).Direction = ParameterDirection.ReturnValue;
            cmd.ExecuteNonQuery();
            Int32 a = Convert.ToInt32(cmd.Parameters["@r"].Value);

            cmd.Dispose();
            con.Close();
        }
Esempio n. 4
0
        public void delete_rec_detfrm(clsdetfrmprp p)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }

            SqlCommand cmd = new SqlCommand("deldetfrm", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@frmcod", SqlDbType.Int).Value = p.frmcod;

            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }
Esempio n. 5
0
        public void update_rec_detfrm(clsdetfrmprp p)
        {
            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            SqlCommand cmd = new SqlCommand("upddetfrm", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@frmcod", SqlDbType.Int).Value             = p.frmcod;
            cmd.Parameters.Add("@frmregcod", SqlDbType.Int).Value          = p.frmregcod;
            cmd.Parameters.Add("@frmtit", SqlDbType.VarChar, 50).Value     = p.frmtit;
            cmd.Parameters.Add("@frmdate", SqlDbType.DateTime).Value       = p.frmdate;
            cmd.Parameters.Add("@frmurl", SqlDbType.VarChar, 100).Value    = p.frmurl;
            cmd.Parameters.Add("@frmdesc", SqlDbType.VarChar, 100).Value   = p.frmdesc;
            cmd.Parameters.Add("@frmreqcont", SqlDbType.VarChar, 50).Value = p.frmreqcont;
            cmd.Parameters.Add("@frmsubmitdate", SqlDbType.DateTime).Value = p.frmsubmitdate;
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }