Пример #1
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            MON_LOP obj = new MON_LOP();

            obj.MOL_ID = int.Parse(dt.Rows[i]["MOL_ID"].ToString());
            //some column
            return((object)obj);
        }
Пример #2
0
        public void delete(MON_LOP mon_lop)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@MOL_ID", SqlDbType.Int, 4, mon_lop.MOL_ID)
            };
            int errorcode = RunProc("usp_DeleteMON_LOP", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
Пример #3
0
        public void update_By_LopId_MonId(MON_LOP mon_lop)
        {
            SqlParameter[] prams =
            {
                //MakeInParam("@MOL_ID",SqlDbType.Int ,4,mon_lop.MOL_ID),
                //MakeInParam("@MOL_Code",SqlDbType.NVarChar,20,mon_lop.MOL_Code),
                MakeInParam("@MOL_LOPID", SqlDbType.Int, 4, mon_lop.MOL_LOPID),
                MakeInParam("@MOL_MONID", SqlDbType.Int, 4, mon_lop.MOL_MONID),
                MakeInParam("@MOL_GIVID", SqlDbType.Int, 4, mon_lop.MOL_GIVID)
                //MakeInParam("@MOL_SoTiet",SqlDbType.Int,4,mon_lop.MOL_SoTiet)
            };
            int errorcode = RunProc("Update_Ma_GiangVien_To_Mon_Lop", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
Пример #4
0
        public void update(MON_LOP mon_lop)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@MOL_ID",     SqlDbType.Int,       4, mon_lop.MOL_ID),
                MakeInParam("@MOL_Code",   SqlDbType.NVarChar, 20, mon_lop.MOL_Code),
                MakeInParam("@MOL_LOPID",  SqlDbType.Int,       4, mon_lop.MOL_LOPID),
                MakeInParam("@MOL_MONID",  SqlDbType.Int,       4, mon_lop.MOL_MONID),
                MakeInParam("@MOL_GIVID",  SqlDbType.Int,       4, mon_lop.MOL_GIVID),
                MakeInParam("@MOL_SoTiet", SqlDbType.Int,       4, mon_lop.MOL_SoTiet)
            };
            int errorcode = RunProc("usp_InsertUpdateMON_LOP", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
Пример #5
0
        public DataTable getByID_MON_LOP(MON_LOP mon_lop)
        {
            connect();
            DataSet DS = new DataSet();

            SqlParameter[] prams =
            {
                MakeInParam("@MOL_ID", SqlDbType.Int, 4, mon_lop.MOL_ID)
            };

            int errorcode = RunProcDS("usp_SelectMON_LOP", prams, out DS);

            if (errorcode > 0)
            {
                throw new Exception("Error!");
            }

            return(DS.Tables[0]);
        }
Пример #6
0
        public DataTable Get_Lop_GiangVien(MON_LOP mon_lop)
        {
            connect();
            DataSet DS = new DataSet();

            SqlParameter[] prams =
            {
                MakeInParam("@MOL_LOPID", SqlDbType.Int, 4, mon_lop.MOL_LOPID),
                MakeInParam("@MOL_MONID", SqlDbType.Int, 4, mon_lop.MOL_MONID)
            };

            int errorcode = RunProcDS("get_Lop_GiangVien", prams, out DS);

            if (errorcode > 0)
            {
                throw new Exception("Error!");
            }

            return(DS.Tables[0]);
        }
Пример #7
0
        public int insert(MON_LOP mon_lop)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@MOL_Code",   SqlDbType.NVarChar, 20, mon_lop.MOL_Code),
                MakeInParam("@MOL_LOPID",  SqlDbType.Int,       4, mon_lop.MOL_LOPID),
                MakeInParam("@MOL_MONID",  SqlDbType.Int,       4, mon_lop.MOL_MONID),
                MakeInParam("@MOL_GIVID",  SqlDbType.Int,       4, mon_lop.MOL_GIVID),
                MakeInParam("@MOL_SoTiet", SqlDbType.Int,       4, mon_lop.MOL_SoTiet),
                MakeInParam("@MOL_ID",     SqlDbType.Int,       4, mon_lop.MOL_ID),
                MakeOutParam("OutID",      SqlDbType.Int, 4)
            };
            int errorcode = RunProc("usp_InsertMON_LOP", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
            else
            {
                return((int)prams[6].Value);
            }
        }