Exemple #1
0
        public static NodeButton Update(NodeButton Updated)
        {
            NodeButton Item = new NodeButton();

            SqlParameter[] obj = new SqlParameter[10];
            obj[0] = new SqlParameter("NB_ID", Updated.ID);
            obj[1] = new SqlParameter("NB_NODE_ID", Updated.NODE_ID);
            obj[2] = new SqlParameter("NB_Ten", Updated.Ten);
            obj[3] = new SqlParameter("NB_MoTa", Updated.MoTa);
            obj[4] = new SqlParameter("NB_Ma", Updated.Ma);
            obj[5] = new SqlParameter("NB_ThuTu", Updated.ThuTu);
            obj[6] = new SqlParameter("NB_NgayTao", Updated.NgayTao);
            obj[7] = new SqlParameter("NB_NguoiTao", Updated.NguoiTao);
            obj[8] = new SqlParameter("NB_NgayCapNhat", Updated.NgayCapNhat);
            obj[9] = new SqlParameter("NB_RowId", Updated.RowId);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblNodeButton_Update_UpdateNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Exemple #2
0
        public static NodeButton SelectById(Int32 NB_ID)
        {
            NodeButton Item = new NodeButton();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("NB_ID", NB_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblNodeButton_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Exemple #3
0
        public static NodeButton getFromReader(IDataReader rd)
        {
            NodeButton Item = new NodeButton();

            Item.ID          = (Int32)(rd["NB_ID"]);
            Item.NODE_ID     = (Int32)(rd["NB_NODE_ID"]);
            Item.Ten         = (String)(rd["NB_Ten"]);
            Item.MoTa        = (String)(rd["NB_MoTa"]);
            Item.Ma          = (String)(rd["NB_Ma"]);
            Item.ThuTu       = (Int32)(rd["NB_ThuTu"]);
            Item.NgayTao     = (DateTime)(rd["NB_NgayTao"]);
            Item.NguoiTao    = (String)(rd["NB_NguoiTao"]);
            Item.NgayCapNhat = (DateTime)(rd["NB_NgayCapNhat"]);
            Item.RowId       = (Guid)(rd["NB_RowId"]);
            return(Item);
        }