예제 #1
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            CHUCDANH obj = new CHUCDANH();

            obj.CHU_ID = int.Parse(dt.Rows[i]["CHU_ID"].ToString());
            //some column
            return((object)obj);
        }
예제 #2
0
        public void delete(CHUCDANH chucdanh)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@CHU_ID", SqlDbType.Int, 4, chucdanh.CHU_ID)
            };
            int errorcode = RunProc("usp_DeleteCHUCDANH", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
예제 #3
0
        public void update(CHUCDANH chucdanh)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@CHU_ID",   SqlDbType.Int,       4, chucdanh.CHU_ID),
                MakeInParam("@CHU_Code", SqlDbType.NVarChar, 20, chucdanh.CHU_Code),
                MakeInParam("@CHU_Name", SqlDbType.NVarChar, 50, chucdanh.CHU_Name)
            };
            int errorcode = RunProc("usp_UpdateCHUCDANH", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
예제 #4
0
        public DataTable getByID_CHUCDANH(CHUCDANH chucdanh)
        {
            connect();
            DataSet DS = new DataSet();

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

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

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

            return(DS.Tables[0]);
        }