Ejemplo n.º 1
0
    public List <BLLChat> SelectMessage(BLLChat objbll)
    {
        List <BLLChat> objlist = new List <BLLChat>();

        SqlParameter[] param = new SqlParameter[2];

        param[0]       = new SqlParameter("@message_from", SqlDbType.NVarChar);
        param[0].Value = objbll.Message_from;

        param[1]       = new SqlParameter("@message_to", SqlDbType.NVarChar);
        param[1].Value = objbll.Message_to;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectmessage", param);
        while (dr.Read())
        {
            objbll              = new BLLChat();
            objbll.Message      = dr["message"].ToString();
            objbll.Message_from = dr["message_from"].ToString();
            objbll.Message_to   = dr["message_to"].ToString();
            objbll.Insert_date  = Convert.ToDateTime(dr["insert_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Ejemplo n.º 2
0
    public int InsertChat(BLLChat objbll)
    {
        SqlParameter[] param = new SqlParameter[5];

        param[0]       = new SqlParameter("@message", SqlDbType.NVarChar);
        param[0].Value = objbll.Message;

        param[1]       = new SqlParameter("@message_to", SqlDbType.NVarChar);
        param[1].Value = objbll.Message_to;

        param[2]       = new SqlParameter("@message_from", SqlDbType.NVarChar);
        param[2].Value = objbll.Message_from;

        param[3]       = new SqlParameter("@message_status", SqlDbType.NVarChar);
        param[3].Value = objbll.Message_status;

        param[4]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[4].Value = objbll.Insert_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertchat", param);

        objcon.CloseConnection();
        return(a);
    }
Ejemplo n.º 3
0
    public List <BLLChat> SelectMessage(BLLChat objbll)
    {
        DALChat objdal = new DALChat();

        return(objdal.SelectMessage(objbll));
    }
Ejemplo n.º 4
0
    public int InsertChat(BLLChat objbll)
    {
        DALChat objdal = new DALChat();

        return(objdal.InsertChat(objbll));
    }