コード例 #1
0
        protected override object GetDataFromDataRow(DataTable dt, int i)
        {
            TINH obj = new TINH();

            obj.TIN_ID = int.Parse(dt.Rows[i]["TIN_ID"].ToString());
            //some column
            return((object)obj);
        }
コード例 #2
0
        public void delete(TINH tinh)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@TIN_ID", SqlDbType.Int, 4, tinh.TIN_ID)
            };
            int errorcode = RunProc("usp_DeleteTINH", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
コード例 #3
0
        public void update(TINH tinh)
        {
            SqlParameter[] prams =
            {
                MakeInParam("@TIN_ID",   SqlDbType.Int,       4, tinh.TIN_ID),
                MakeInParam("@TIN_Code", SqlDbType.NVarChar, 10, tinh.TIN_Code),
                MakeInParam("@TIN_Name", SqlDbType.NVarChar, 20, tinh.TIN_Name)
            };
            int errorcode = RunProc("usp_UpdateTINH", prams);

            if (errorcode > 0)
            {
                throw new Exception("Error");
            }
        }
コード例 #4
0
        public DataTable getByID_TINH(TINH tinh)
        {
            connect();
            DataSet DS = new DataSet();

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

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

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

            return(DS.Tables[0]);
        }